We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Excel to PDF signed file

We are evaluating Aspose Cells for .NET as a candidate to create secure PDF files. The example documentation does not indicate that it can be done although some functions indicate it might be possible. Is it possible or would we need to convert the Excel file to PDF, and then use Aspose PDF for .NET to create the signed PDF file?

Hi,

Thanks for your posting and using Aspose.Cells.

Yes, it is possible to secure output pdf using Aspose.Cells. Please see the following documentation article explaining how to secure output pdf using Aspose.Cells API for your reference. Let us know your feedback.

( http://www.aspose.com/docs/display/cellsnet/Secure+PDF+Documents )

Thank you for the response. We need to be able to use digital signatures with a certificate. Can that be done with Aspose.Cells?

Hi,

Thanks for your posting and considering Aspose.Cells.

Please let us know if the following document is helpful for you in this regard.

( http://www.aspose.com/docs/display/cellsnet/Assign+and+Validate+Digital+Signatures )

If it is not helpful, then please let us know how do you create digital signatures with certificates manually so that we could look into this issue in Aspose.Cells. Also, we think, this feature will be available in Aspose.Pdf, so please do post your query/issue in the Aspose.Pdf forum too.

Ok, now things are starting to work. However when I created the certificate and signature and added it to the signature collection and added that to the workbook. Then I saved the workbook as a PDF, but the signature did not apply to the PDF, the PDF remained unsigned.

We don’t need the .xlsx file signed, only the PDF. Additionally we require a watermark on every page of the PDF. I didn’t see any sample code to generate watermarks although that seems doable, maybe through setting a background picture on a per page basis. Aspose.Cells appears promising, but we need to determine if it meets our needs in the next week.



Here’s my code snipit…



Workbook wb = new Workbook(inputFile);



Worksheet worksheet = wb.Worksheets[0];



// Set scaling to 100% (no scaling) and turn gridlines off.

worksheet.PageSetup.Zoom = 100;

worksheet.PageSetup.PrintGridlines = false;



if (parser.bSecure)

{

DigitalSignatureCollection dsc = new DigitalSignatureCollection();



X509Certificate2 cert = new X509Certificate2(ConverterConst.CERT_FILE, ConverterConst.CERT_KEY);



DigitalSignature ds = new DigitalSignature(cert, “Signature created by FMS Reports (suport@cygnet.com)”, DateTime.Now);



dsc.Add(ds);



wb.SetDigitalSignature(dsc);

}



if (parser.bWatermark)

{

}



wb.Save(outputFile, SaveFormat.Pdf);



******************

The PdfSecurityOptions offered by Aspose.Cells doesn’t appear to support signing.



Aspose.PDF supports signing, but can’t convert directly from .xlsx to .PDF. Even if we purchase both packages (or Total) it still means a somewhat cumbersome 2 step process to create the PDF file then open the PDF, add the certificate and signature and re-save.

http://www.aspose.com/docs/display/cellsnet/Add+WordArt+Watermark+to+Worksheet

Thanks, I’ll work with that…

Hi,

Thanks for your posting and considering Aspose APIs.

From your last post, it seems your issue is resolved. However from your above post i.e 673314, it seems you are still having some problems. Could you please confirm it if your issue is resolved or not?

Yes, I still have not been able to create a signed PDF from an Excel file using Aspose.Cells. When I run the snipit of code I posted earlier, with parser.bSecure set to true, an unsigned PDF is generated. I need to know if Aspose.Cells is capable of generating signed PDF files.

Hi,

Thanks for your clarification and using Aspose.Cells.

As you have mentioned earlier Aspose.Pdf is able to create signed pdf, could you please share the document article so that we could look into this issue in Aspose.Cells perspective. We will investigate it and let you know if Aspose.Cells does support this feature or not.

Attached is the generated PDF file from the posted snipit of code.



We would much prefer to purchase only one module so if Aspose.Cells can meet our needs that would be much preferred. We have experimented with a combo of Aspose.Cells and Aspose.PDF. I will post the current status of that in a follow-up post.

Current state of evaluation:

Unfortunately it requires both the Aspose.Cells and Aspose.PDF products.

Using both, I was able to create a signed/encrypted PDF file (attached)



Issues:

1. In order to access the signature, the SignatureField must be displayed. Acrobat Reader DC is unable to browse the signature and display it in the Signature panel. (this may be due to encryption). We would prefer not to have the SignatureField displayed and still be able to access the signature.

2. It doesn’t appear that we can sign a file without encrypting the file. encryption is not a requirement, only certifying the file with a signature. This may not be an issue as encryption may become a requirement in the future.



Additional implementation question:

I need to create a watermark from a bitmap stored in the resources. I couldn’t find a example to convert a resource bitmap to an Aspose.PDF Image. I don’t know if a bitmap can be imported to an Image directly or if an intermediate step is necessary.

Hi,

Thanks for your illustration of this issue and considering Aspose APIs.

After initial investigation, I found this feature is not available. However, I will discuss it with team and let you know if it is already available or if this issue should be logged as a new feature requirement in our database for implementation. Besides, I think, product team will not agree with it because this is basically a PDF feature and not Excel feature. Aspose.Cells deals with Excel features only.

Do you have any idea that Microsoft Excel could create such signed PDFs? If you know it exists, then please share the steps. If the feature is available in Microsoft Excel then product team will automatically like to add it in future versions. Thanks for your cooperation in this regard.

Thanks for the response. I still need help addressing the watermark problem (creating a watermark image from a resource embedded bitmap).

Excel can only generate a PDF file. Acrobat Reader Pro can do the signing. In that respect you match the product capabilities.

Hi,

Thanks for your posting and considering Aspose.

Do you need something as mentioned in this article? i.e

Use a picture in a header or footer to mimic a watermark

( https://support.office.com/en-us/article/Mimic-a-watermark-in-Excel-c0d80606-9f83-4189-8eb0-c174e7d97d2d )

If yes, then please see the following article that explains how to work with headers & footer using Aspose.Cells APIs.

( http://www.aspose.com/docs/display/cellsnet/Setting+Headers+and+Footers )


We’ve been able to accomplish all requirements except one. We need an invisible signature like Aspose.Word provides. Does Aspose.PDF provide invisible signatures? I couldn’t find any reference in the documentation. The visible certificate in the rectangle does not meet our requirement.

Hi,

Thanks for sharing with us great news and considering Aspose APIs.

Since your question is related to Aspose.Pdf, so we are are moving your thread to Aspose.Pdf forum. Aspose.Pdf support team will look into your issue and help you asap.

Hi Bruce,

bruce.detter:
We've been able to accomplish all requirements except one. We need an invisible signature like Aspose.Word provides. Does Aspose.PDF provide invisible signatures? I couldn't find any reference in the documentation. The visible certificate in the rectangle does not meet our requirement.

Thanks for your inquiry. You can also set visibility of digital signature as per your requirement while signing PDF document in Aspose.Pdf for .NET. Please use following overload for the purpose and use visible parameter for setting visibility of signature.

public void Sign(int page, string SigReason, string SigContact, string SigLocation, bool visible, System.Drawing.Rectangle annotRect);


Please feel free to contact us for any further assistance.


Best Regards,