PDF layers (OCG) don't work with vbs
Posted: Thu Mar 10, 2022 12:23 pm
Hi all,
I took the simple example from the documentation: "Using PDF Layers or Optional Content Groups" consisting of putting an image in the background only when printing. Attached GdPicture_Bug_OCG.zip, containing in a file the vb script, an image, and the PDF produced by the script.
The script creates a PDF from scratch, puts the image in it and links it to the created layer, and saves it as "OCG_bug_demo.pdf" at the same level as the script.
The active part of the example goes from lines 39 to 77 (I have kept some utility methods that do not influence the demonstration of the problem and facilitate the implementation of GdPicture).
At line 63, the image is linked to the layer "Watermark image layer"
On line 67 we make this layer visible when printing
On line 71 we make it invisible on the screen.
When you open the PDF, it is empty, the image is invisible on the screen. It's OK. The "Watermark image layer" layer is present in the list of layers, and the image appears if it is made visible.
When printing, the result is empty: the image is not printed, which is abnormal.
GdPicture 14.1.128.
Regards
I took the simple example from the documentation: "Using PDF Layers or Optional Content Groups" consisting of putting an image in the background only when printing. Attached GdPicture_Bug_OCG.zip, containing in a file the vb script, an image, and the PDF produced by the script.
The script creates a PDF from scratch, puts the image in it and links it to the created layer, and saves it as "OCG_bug_demo.pdf" at the same level as the script.
The active part of the example goes from lines 39 to 77 (I have kept some utility methods that do not influence the demonstration of the problem and facilitate the implementation of GdPicture).
At line 63, the image is linked to the layer "Watermark image layer"
On line 67 we make this layer visible when printing
On line 71 we make it invisible on the screen.
When you open the PDF, it is empty, the image is invisible on the screen. It's OK. The "Watermark image layer" layer is present in the list of layers, and the image appears if it is made visible.
When printing, the result is empty: the image is not printed, which is abnormal.
GdPicture 14.1.128.
Regards