LinearizeForWeb ignored in SetFileNameOptions()

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

LinearizeForWeb ignored in SetFileNameOptions()

Post by avanderwoude »

When I generate a PDF through the printer driver I specify several constants in the call to SetFileNameOptions(): NoPrompt, UseFileName, MultilingualSupport, EncryptDocument, and LinearizeForWeb. The LinearizeForWeb constant appears to be silently ignored, however. No error is reported, but when I check the PDF that was produced it always says that Fast Web View is No.

Do I have to set another constant to make this work?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

I tried your same settings and was able to get a pdf file that is encrypted and linearized.

I am using the latest version 2.10i of the PDF Converter. Please try to update your current version of the driver to check that this works.

Thanks.
avanderwoude
Posts: 11
Joined: Tue Apr 06 2004

Post by avanderwoude »

I downloaded the 210i drivers and installed them. There is no change in behavior: the produced PDF still reports that Fast Web View is No.

To clarify what I am doing the following may help. First of all, I'm calling the dll from inside a Python dll which is called from inside a Powerbuilder app.

When I installed the PDF printer driver on my box the following steps were performed:
- DriverInit("MyPrinter") <-- the Amyuni PDF printer, obviously
- SetOwnerPassword(printerHandle, "MyPassword")
- SetFileNameOptions(printerHandle, options)
where options is NoPrompt | UseFileName | MultilingualSupport | EncryptDocument | LinearizeForWeb
- SetPermissions(printerHandle, permissions)
where permissions is -64 + 4 + 16 + 32 (modification not allowed)
- SetDefaultConfigEx(printerHandle)
- DriverEnd(printerHandle)
The idea is that various defaults are set that will be applied to all PDF files produced.

At application startup the driver is initialized:
- DriverInit("MyPrinter")
- SetLicenseKeyA("MyCompany", "MyLicenseKey")

Then, in the application, to generate the PDF:
- Lock(printerHandle, "MyDocument")
- SetDocFileProps(printerHandle, "MyDocument", options, dir, fileName)
where options is NoPrompt | UseFileName | MultilingualSupport | EncryptDocument | LinearizeForWeb
and dir is the directory where the PDF will be created
and fileName is the full name of the PDF file that will be created
- EnablePrinter(printerHandle, "MyCompany", "MyLicenseKey")
- The document is printed to "MyPrinter" using standard Powerbuilder printing techniques.
- UnLock(printerHandle, "MyDocument", 5000)

At application end the driver is closed:
- DriverEnd(printerHandle)

I hope that the sequence of calls is correct. PDFs are being produced, and modification is not allowed while annotation, copying, etc. are allowed, just as expected. Furthermore, you can provide the owner password in the PDF and gain access to all features, again just as expected. The only thing that does not appear to work is the LinearizeForWeb bit passed to SetFileNameOptions().
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

So you are using linearization from withing the locking mechanism.

Now I am able to reproduce the issue you are mentioning.

I will forward it to our developers to solve it in the next release.

Please send your below issue to support@amyuni.com while mentions "Bug reproduced by Joan" so we can get back to you when this is solved.

Thanks.
avanderwoude
Posts: 11
Joined: Tue Apr 06 2004

Post by avanderwoude »

As a work-around I am now calling LinearizePDFDocument() after the PDF has been created, which seems to work fine.

Any idea when the next release will be?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Yes, linearizing the pdf file after it is generated using the Document Interface of CDIntf should work fine.

I am not sure when the next release will be ready, but if you sent a request to support@amyuni.com than you will be notified when the fix is online.

Have a nice day !
Post Reply