Sign a pdf file created with Aspose.Pdf for .Net

Hello to everyone,
I’ve a problem with a licensed Aspose.Pdf for .Net.
I used 17.5 and 17.7 version.
My scope is sign a pdf file with jsignpdf twice, i need to apply 2 signature on my pdf document.

I create a pdf file with Ms-Word by Save As Pdf and i sign it with jsignpdf twice; all is Ok, the two signature are valid.

I open previous pdf with aspose library as a document and simply save it with another name (no options).
Than, get the new pdf (aspose save) and i sign it with jsignpdf twice; first sign becames invalid.

I’ve notice that pdf after save by aspose has a different file size.

Save method has saveOptions arguments, are there some options to be used ?

This is my test code:

    Dim l As Aspose.Pdf.License
    Dim docItem As Aspose.Pdf.Document = Nothing
	...
	l = New Aspose.Pdf.License
	l.SetLicense("Aspose.Pdf.lic")
	...
	docItem = New Aspose.Pdf.Document(myFileName)
	...
	docItem.Save(resultFileName)

Thanks

I have solved my problem.

Before “Save” the document
it’s necessary perform a “Optimize” of the document pdf.

With “Optimize” before “Save”
the document pdf is signed twice correctly with jsignpdf.

I hope it’s useful to others

@Emisfera

Thanks for acknowledging us.

It is good to know that your issue has been resolved. Please keep using our API and in event of any other query, please feel free to let us know.

One more note about this problem.
Previously saved documents without “Optimize”
becomes demaged if i reopen it, apply “Optimize” and “Save”.

In the other hand, if i reopen a file optimized and save it, the file is Ok.

thanks for your attention

@Emisfera

Thanks for sharing details with us.

Would you please share the document with us, so that we can also observe this behavior in our environment and address it accordingly.

Test_document_with_signatures.zip (637.3 KB)

It’s simple to generate the problem.
Creates a word document (2010) and save it as pdf.
Opens pdf and goes to Document properties, you can see the property “Fast Web View: No”.
Ok, this file is not Linearized !
Use this file to open and save without optimize with aspose pdf for .net library.
Now use saved file and open, optimize and save it with aspose library.
Sometimes save method give an exception (view attached file please) and sometimes ends save method (no exception)
but the resulting file has damaged.
Best regards.

@Emisfera

Thanks for sharing the requested document(s).

I have tested the scenario in our environment and managed to notice the exception at Document.Save() method after optimizing previously saved document. Hence I have logged an issue as PDFNET-43118 in our issue tracking system. We will further investigate it and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-43118) have been fixed in Aspose.PDF for .NET 23.9.