Tuesday, March 28, 2006

Peekaboo in PDF - Optional Contents

This might be a geeky thing to write, but i find PDF so damm interesting that i can't help but write about some of the features that I really love. Also, this might just be a small technical tutorial on one such topic in PDF which would help me (most of all ) in the future. Thats about Optional Contents in PDF.
Optional content is an appropriatly used term to signify a content in PDF that can be optionally viewed/printed/exported. You might call them layers in few cases. This gives the power to the PDF to hide its content depending upon various factors (called usage). Optional content is very clearly mentioned in the PDF reference manual. There are something called Optional content groups (OCGs),which controls the visibility of a graphics object. This is a dictionary (as every other thing in PDF) which contains a usage dictionary which specifies the nature of the content controlled by the group. For Example, Print = OFF meaning the content in the group can not be printed or, User = xxx,yyy meaning that xxx and yyy can view the document. Next is to determine the state of the optional content groups. There is an OCProperties dictionary which contains the list of OCGs it is refering to and the default states. This contains an AS array which has an event depending upon which the state of an OCG changes.
This might not be that interesting. The more interesting is the impact it has.
This is a good place to start. This example shows how PDF has the power to change its content depending on the zoom value.

0 Comments:

Post a Comment

<< Home