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?
LinearizeForWeb ignored in SetFileNameOptions()
-
- Posts: 11
- Joined: Tue Apr 06 2004
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().
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().
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.
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.
-
- Posts: 11
- Joined: Tue Apr 06 2004
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 !
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 !