Exception in PDF Converter 3.00's LinearizePDFDocument()

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
avanderwoude
Posts: 11
Joined: Tue Apr 06 2004

Exception in PDF Converter 3.00's LinearizePDFDocument()

Post by avanderwoude »

Our clients have reported a problem that sometimes occurs when linearizing an encrypted PDF, and we have sometimes seen this error ourselves as well. The exception code is 0xe06d7363. A Google search yields the page http://support.microsoft.com/kb/185294 to explain this exception.

Unfortunately, we cannot reproduce this condition reliably, so I cannot give you any code to try. The best I can do is to explain what I'm doing, and hopefully you can figure something out from that.

We are using PDF Converter 3.00, not 3.02. I tried 3.02, but that seems to have problems encrypting PDFs using the EncryptPDFDocument() method, so I abandoned that. By the way, using the SetFileNameOptions() to encrypt works great, but that does not give us enough fine control over exactly what things are allowed and not allowed, so we cannot use that technique.

We linearize after encrypting because in our experience encrypting using the function calls removes any linearization.

In our product we are calling the Amyuni dll functions from inside Python. The exception I mentioned above appears to be thrown inside the dll's LinearizePDFDocument() function, as we don't get a return value. A call to GetLastErrorMsg() when this occurs returns "The operation completed successfully.", which is not true!

The PDF is okay even though the linearization failed. It is still readable and correctly encrypted, but obviously Acrobat reports that it is *not* optimized for web viewing.

I hope you find this information helpful, and perhaps your next release will be able to address these problems.
Devteam
Posts: 119
Joined: Fri Oct 14 2005
Location: Montreal
Contact:

Re: Exception in PDF Converter 3.00's LinearizePDFDocument()

Post by Devteam »

Once a document is encrypted, you cannot modify it even if it is to optimize it for the web. So Linearization should come before or at the same time as encryption.

We recently fixed an issue whereby Linearization was being removed if the document is encrypted. The fix will be in our next 3.03 release. The post also mentions that encryption is not working in 3.02 but we did not find any issue with that, so the problem needs to be further clarified.

On a related note, using the ActiveX interface is recommended because it allows Linearization and Encrpytion to be done simultaneously so this is far more efficient on large file. The DLL interface requires opening the PDF and saving it for each operation. The ActiveX pseudo-code would look like:
Open
Linearized = True
Encrypt
Save

Amyuni Development Team
http://www.amyuni.com
Visit Amyuni at Microsoft Tech-Ed Developers - Booth 1029
Amyuni Development Team

Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com
Post Reply