adobe / adobe/PDFServices.NET.SDK.Samples

SetSealImageAsset() is ignored by .NET SDK (v4.3.1)

Đang mở
#40 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
HTML
Star
47
Fork
23
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

# Bug Report: `SetSealImageAsset()` is ignored by .NET SDK (v4.3.1)

## Summary

When using the .NET SDK (`Adobe.PDFServicesSDK` v4.3.1) to create an Electronic Seal, the custom seal image provided via `SetSealImageAsset()` is not rendered in the resulting PDF.

The exact same workflow and assets work correctly when submitting the Electronic Seal job through the REST API using `sealImageAssetID`.

This suggests that the issue is related to the SDK submit implementation rather than the backend service or the uploaded assets.

---

## Environment

- SDK: `Adobe.PDFServicesSDK` **4.3.1**
- .NET: (please insert your version)
- Authentication: Service Principal
- CSC Provider: Intesi
- Credential Type: CSC
- Signature: Electronic Seal

---

## Expected Behavior

The custom seal image supplied through:

```csharp
pdfElectronicSealJob.SetSealImageAsset(sealImageAsset);
```

should be rendered as part of the visible electronic seal.

---

## Actual Behavior

The PDF is sealed successfully.

The visible seal is rendered, however the custom seal image is ignored and only the default appearance is shown.

---

## What was verified

The following have been verified:

- ✅ PDF is successfully sealed.
- ✅ CSC authentication works correctly.
- ✅ Intesi access token is valid.
- ✅ Input PDF uploads successfully.
- ✅ Seal image uploads successfully.
- ✅ `AppearanceOptions` contains `AppearanceItem.SEAL_IMAGE`.
- ✅ `SetSealImageAsset()` is called before submitting the job.
- ✅ JPEG, PNG and PDF seal images were tested.
- ✅ Different image sizes were tested.
- ✅ Different signature field sizes and locations were tested.

---

## Important Finding

I implemented the exact same workflow using the REST API.

The only difference is that instead of:

```csharp
pdfElectronicSealJob.SetSealImageAsset(sealImageAsset);
```

the REST request contains:

```json
{
"sealImageAssetID": ""
}
```

The REST implementation renders the custom seal image correctly.

The uploaded asset IDs are identical to those uploaded through the SDK.

---

## Comparison

| Step | SDK | REST |
|------|-----|------|
| Upload PDF asset | ✅ | ✅ |
| Upload seal image asset | ✅ | ✅ |
| CSC authentication | ✅ | ✅ |
| Submit Electronic Seal job | ✅ | ✅ |
| Seal image rendered | ❌ | ✅ |

---

## Sample SDK code

```csharp
AppearanceOptions appearanceOptions = new AppearanceOptions();
appearanceOptions.AddItem(AppearanceItem.NAME);
appearanceOptions.AddItem(AppearanceItem.LABELS);
appearanceOptions.AddItem(AppearanceItem.DATE);
appearanceOptions.AddItem(AppearanceItem.SEAL_IMAGE);
appearanceOptions.AddItem(AppearanceItem.DISTINGUISHED_NAME);

PDFElectronicSealParams parameters =
PDFElectronicSealParams.PDFElectronicSealParamsBuilder(
certificateCredentials,
fieldOptions)
.WithAppearanceOptions(appearanceOptions)
.Build();

PDFElectronicSealJob job = new PDFElectronicSealJob(asset, parameters);

job.SetSealImageAsset(sealImageAsset);

string location = pdfServices.Submit(job);
```

---

## Working REST payload

```json
{
"inputDocumentAssetID": "...",
"sealImageAssetID": "...",
"sealOptions": {
"sealAppearanceOptions": {
"displayOptions": [
"NAME",
"LABELS",
"DATE",
"SEAL_IMAGE",
"DISTINGUISHED_NAME"
]
}
}
}
```

This renders the custom seal image correctly.

---

## Conclusion

Since:

- the same uploaded assets are used,
- the same CSC credentials are used,
- the same provider is used,
- the same appearance options are used,

and only the SDK implementation fails to render the seal image, while the REST API works correctly,

it appears that the .NET SDK is not submitting the seal image correctly (or is generating a different request than the REST API).

Could you please verify whether `SetSealImageAsset()` is correctly serialized into the request sent by the .NET SDK?

If needed, I can also provide:

- sample input PDF
- sample seal image
- working REST implementation
- non-working SDK implementation
- transaction IDs

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách so sánh request được .NET SDK gửi đi với REST payload đang hoạt động, tập trung vào cách SetSealImageAsset() được serialize. Xác minh rằng request có chứa sealImageAssetID và xác nhận hoàn tất khi hình ảnh con dấu tùy chỉnh được render trong PDF kết quả.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp
Lĩnh vực
api
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.