[poppler] Problem understanding Optional Content

Brad Hards bradh at frogmouth.net
Tue Nov 6 12:41:32 PST 2007


On Wednesday 07 November 2007 03:06, Leonard Rosenthol wrote:
> Optional Content is basically the application of boolean logic on
> pieces of a PDF during the rendering process.
Yep, OK with that.

> The PDF provides a list of the OCGs (and OCMDs - OC Membership
> Dictionaries) and the viewer's job is to determine (at any given time
> during the viewing & printing process) which pieces of content (and
> annotations) should be shown or not.   In order to do this, you need
> to maintain the list of OCGs and their boolean expressions as well as
> whether they have any "auto states" (which determine whether a user-
> imposed condition such as the act of printing or zooming to a
> specific zoom factor change the expressions).
I understand these requirements. The first part (about a list, and a boolean 
expression)  isn't too bad to manage. Not sure about the implementation for 
the auto-state thing though...

> Then as you render, you need to check each piece of content to see if
> it lies inside of an OCG, and whether that OCG is "On" or "Off" at
> this time.
Yep. What I don't see is "how do I tell if this item is part of an OCG or not" 
for most of the items. I see it for a few obvious examples - there are six 
objects that are labelled as part of the OC group for object 25 ("Layout D"). 
However I don't see anything else labelled as part of the other 8 OCGs.

I see that setting layers does have visual effect in acroread. I don't see how 
though.

To put it another way: which object # is turned off by the Information layer 
(the big pink blob on page 1), and how/why?

> For PDF 1.5, when they were first introduced - the boolean
> expressions were quite simplistic.  However, in PDF 1.6, a new
> "Visibility Expression (VE)" was introduced that allows for quite
> complex expressions.
>
> If you need any more samples or help - just holler!   It would be
> great to see a Poppler client support OCGs...
Samples are always good :-) In particular, something showing OCMD, and 
something showing VEs would be very nice. Even nicer if we can redistribute 
them in our test cases.

Thanks again, as always.

Brad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20071107/48301e66/attachment.pgp 


More information about the poppler mailing list