I want to upgrade from Aspose.Cells 5.0 to Aspose.Cells 24.9, so I am now using trial version to test the SignatureLine and Digital Signature function. I can create an image. When I add the picture to a SignatureLine, the image cannot be shown in the signature position. Even I add a DigitalSignature and passed the Id and ProviderId from the SignatureLine to the DigitalSignature, the image is still not shown (in both excel and pdf). I re-open the saved excel file, and it is signed. Please help. Thanks.
Here are the codes:
Dim wIndex As Integer = gWS.Pictures.Add(0, 0, "C:\Temp\TestSignature.jpg")
Dim wPic As Aspose.Cells.Drawing.Picture = gWS.Pictures(wIndex)
Dim wSignatureLine As New Aspose.Cells.Drawing.SignatureLine
wSignatureLine.Id = Guid.NewGuid()
wSignatureLine.ProviderId = Guid.Empty
wSignatureLine.Signer = "TESTER"
wSignatureLine.Title = "tester"
wPic.SignatureLine = wSignatureLine
Dim wCertFileName As String = "C:\TestKey.pfx"
Dim wPwd As String = "123456"
Dim dsc As New Aspose.Cells.DigitalSignatures.DigitalSignatureCollection()
Dim cert As New System.Security.Cryptography.X509Certificates.X509Certificate2(wCertFileName, wPwd)
Dim ds As New Aspose.Cells.DigitalSignatures.DigitalSignature(cert, "test1", DateTime.Now)
ds.Id = wSignatureLine.Id
ds.ProviderId = wSignatureLine.ProviderId
Call dsc.Add(ds)
gWB.SetDigitalSignature(dsc)
gWB.Save("C:\Temp\newfile_out.xlsx", SaveFormat.Xlsx)
gWB.Save("C:\Temp\Test_NewAspose_2.pdf", SaveFormat.Pdf)
It appears that you are experiencing issues with displaying an image in a SignatureLine after signing the document using Aspose.Cells. Currently, Aspose.Cells does not support displaying images in Microsoft Signature Lines in Excel spreadsheets. This limitation has been acknowledged, and a ticket has been logged to address this issue.
To ensure that you are using the correct approach, here are a few points to consider:
Version Compatibility: Make sure you are using a version of Aspose.Cells that supports signing Microsoft Signature Lines. The support for this feature was introduced in version 21.2.8. Since you are upgrading from version 5.0 to 24.9, you should be fine, but it’s worth confirming that the specific version you are testing includes this functionality.
Image Assignment: When you create a digital signature, ensure that you are correctly assigning the image to the signature. The code snippet you provided does not explicitly set the image for the digital signature. You may need to include a line to assign the image to the DigitalSignature object, similar to the following:
Testing in Excel and PDF: After saving the workbook, check both the Excel file and the PDF output to see if the image appears in either format. If it does not appear in both, it may indicate a broader issue with how the signature is being processed.
Reviewing Documentation and Examples: It may be helpful to review the official documentation and examples provided by Aspose for managing digital signatures and signature lines. This can provide additional insights into the correct implementation.
If you continue to face issues, consider reaching out to Aspose support for further assistance, as they may provide updates or workarounds for this specific limitation.
Afer adding the code ds.Image = File.ReadAllBytes(“C:\Temp\TestSignature.jpg”), I can see the image in the SignatureLine in the Excel file.
However, it is still not shown in PDF.
@Yu_Tak
By testing with sample files and code on the latest version v24.10, we can reproduce the issue. Found no image shown even after using signedSignatureLine with SetDigitalSignature.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-57011
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
This is to inform you that your issue (Ticket ID: “CELLSNET-57011”) has been resolved. The fix/enhancement will be included in our upcoming release (Aspose.Cells v24.11) that we plan to release in this week. You will be notified when the next version is released.
The issues you have found earlier (filed as CELLSNET-57011) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi