(Deutsche Version)
In my article Acrobat PDF Form Felder auf Ebenen I have explained the problem in detail: I want to create layers in a PDF file and put Form Fields or Annotations into these layers or Optional Content Groups (OCG).
Back then, I solved the problem by means of Acrobat SDK Snippet Runner. An architecture that enables you to run individual Snippets as a plug-in in Acrobat. Quite nice for a first try, but in the end not a solution that should be distributed. Developery only.
For this reason, I took a closer look at the SDK and built a proper plug-in:
The plug-in links into the Advanced menu of Acrobat and is only active when a document is loaded. When called, it asks for a text file. This file determines which annotations are put into which layers. Layers that are not present will be created.
The structure of the text file is very simple. Each line contains the name of an annotation, the | character, and then the name of the related layer:
TestAnnotation1|TestLayer1 TestAnnotation2|TestLayer2
When editing in Acrobat, it is possible that the layer information for the Annotations gets lost. In this case, simply run the same text file again. Assigning fields that are already present does not have any negative effect.
Disclaimer:
Have fun with the plug-in, and maybe you want to send me a feedback:
CPTecLayerPlugin.zip (180 KB)
© Copyright 2012, Christian Deger
E-mail