How to make PDF layers (optional content group) in tree structure

I recently posed a question on how to use an additional pdf content group. But now I have a new question. How to make this additional content group in a tree structure.

For example. I have 4 different layers. these layers represent the entire OCG layer. 3 layers - text labels, 1 layer - graphic object veccotr. So I want it to show like:

Alllayers
   ---labels
       --layer1
       --layer2
       --layer3
   ---layer4

      

I am using pdf document as example enter image description here

this is in Chinese, the chinses character is the name of the layer. It is this meaning.

+3


source to share


1 answer


The answer to this question will depend on which PDF library you are using to create your files. In general, you will need to create a file with an Order array in an additional content configuration dictionary that represents the tree you want to display.

From PDF Reference Document :



Key: Order
Type: Array
Description: (optional) An array that specifies the order in which additional content groups are presented in the user interface of their respective readers. Array elements can include the following objects:
-Optimal vocabulary content groups, whose name entry should be displayed in the user interface by the appropriate reader.
-Harries of optional content groups that can be displayed by the appropriate reader in a tree or outline structure. Each nested array can optionally have a text string as its first element, which will be used as a non-selectable label in the reader's user interface.

+4


source







All Articles