Sunday, March 28, 2010

outline dictionary count

I am having trouble understanding the value to declare for /Count in an outline dictionary object and an outline item dictionary object. I found the errata for the PDF Reference 1.7, and that helps, but doesn't clear up the confusion totally. A good example in the documentation would be great. Hint!

For an outline dictionary, does the count include those open items below a closed item? I believe that the answer is yes, per the PDF Reference 1.7 Errata.

For an outline item dictionary, same question. After reading the PDF Reference 1.7 Errata, it seems like the answer is no.

The attached file contains a some example outline dictionary objects. In the example, Section 2 is a closed item. All of the descendants of Section 2 are open. I believe that all of the information in the dictionaries correct except for the count.

outline dictionary count

Remember that the PDF 1.7 Reference has been superseded by the ISO 32000-1 document. So I am going to be using that as reference for the answers.

The Document Outline is in Clause 12.3.3. table 152 has the entries for the Outline dictionary. For the Count Key, it says: ''(Required if the document has any open outline entries) Total number of visible outline items at all levels of the outline. The value cannot be negative. This entry shall be omitted if there are no open outline items.'' As such, it is quite clear that the value is ALL open/visible entries at ALL levels.

For the Outline Item (Table 153), the description of Count reads:

(Required if the item has any descendants) If the outline item is open,

Count is the sum of the number of visible descendent outline items at

all levels. The number of visible descendent outline items shall be

determined by the following recursive process:

Step 1. Initialize Count to zero.

Step 2. Add to Count the number of immediate children. During

repetitions of this step, update only the Count of the original

outline item.

Step 3. For each of those immediate children whose Count is

positive and non-zero, repeat steps 2 and 3.

If the outline item is closed, Count is negative and its absolute value is

the number of descendants that would be visible if the outline item

were opened.

Again, quite clear what the value should be.

Please switch to the current international standard documentation...

No comments:

Post a Comment