2 Replies Latest reply on Jan 7, 2014 7:56 AM by rob day

    How do I obtain the names of graphic layers from a PDF?

    magulasp

      I want to write an applescript that will extact the layer names from a PDF imported into InDesign. However, the only layer name it returns is the separator layer "Test.indd" and not the actual layers contained in the PDF.

       

      The PDFs are saved from AI to include layers. Anyone have any suggestions on how to drill down into the serarator layer to get the other layer names?

       

      Thanks,

       

      Sean M.

        • 1. Re: How do I obtain the names of graphic layers from a PDF?
          Steve Werner Adobe Community Professional & MVP

          You'll need to ask in the Acrobat forums most likely to find someone who understands how the layers are stored in the PDF. Not likely in this forum.

          • 2. Re: How do I obtain the names of graphic layers from a PDF?
            rob day Adobe Community Professional & MVP

            I don't see anything in the ID dictionary that lets you get PDF or AI layers. You might ask in the scripting forum if it can be done with a JavaScript  do script.

             

            You could open the PDF in AI and get the names like this, which displays the names of a selected PDF's layers from AI—I don't think you can do it in Acrobat.

             

            tell application "Adobe InDesign CS6"

                activate

                set myPath to file path of item link of selection of active document as alias

                tell application "Adobe Illustrator"

                    open myPath

                    set myLayers to name of every layer of document 1

                    close document 1 saving no

                end tell

               

                set layerList to "Layers in current selection: " & return

               

                 --reverse loop gets the layers from the bottom up

                repeat with i from number of items in myLayers to 1 by -1

                    set x to item i of myLayers

                    set layerList to layerList & x & ", "

                end repeat

               

                display dialog layerList

            end tell