Frequently Asked Question:
How to include XMP metainformation
Can you give an example of how to include additional metainformation into the pdf-file (as pdf/a has to support). I tried to to so, but had no success. May be the xml-structure was not correct. Are you able to show an example of the xml you used during develooment. Thanks in advance Klaus.
Yes, it's definitely possible to have a watermark displayed only when a page is printed. I've included some basic sample code for this below.
QP.UnlockKey(' ...license key... ');
QP.DrawText(100, 500, 'No OCG (View and print)');
QP.NewLayer;
QP.DrawText(100, 400, 'Apple OCG (No view, print)');
OC1 := QP.NewOptionalContentGroup('Apple');
QP.SetLayerOptional(OC1);
QP.NewLayer;
QP.DrawText(100, 300, 'Banana OCG (View, no print)');
OC2 := QP.NewOptionalContentGroup('Banana');
QP.SetLayerOptional(OC2);
QP.SetOptionalContentGroupVisible(OC1, 0);
QP.SetOptionalContentGroupPrintable(OC1, 1);
QP.SetOptionalContentGroupVisible(OC2, 1);
QP.SetOptionalContentGroupPrintable(OC2, 0);
QP.SaveToFile('qplwatermark.pdf');
Please note: this example demonstrates how to do it both ways -- that is to say, how to have the watermark displayed on screen but not printed, and how to have the watermark not shown on the screen, but printed. It's easy to switch between the two options.
In addition, you may like to add some PDF security to the document so that the end-user can't delete the optional content groups/layers.
