9 Replies Latest reply on Jun 24, 2014 7:35 AM by bingandham

    Multi paged document into individual PDF pages - with names

    bingandham Level 1

      I have an InDesign document that I use to create sell sheets for groups of sales people using data merge.

      I'm wondering if there's an easy way to extract these pages as individual pdf pages that have the names of each page (D_Smith.pdf, RJones.pdf etc.)

       

      Currently I do this using Acrobat and extract pages and manually tag each pdf.

        • 2. Re: Multi paged document into individual PDF pages - with names
          rob day Adobe Community Professional & MVP

          I don't do much with data merge, but you should have a master page item with the name field—so it could be scripted. The master page name field could be given a script label and then the content from the name field on each page could be picked up and used as the PDF title.

          • 3. Re: Multi paged document into individual PDF pages - with names
            rob day Adobe Community Professional & MVP

            If you are using OSX I have an AppleScript that might work

            • 5. Re: Multi paged document into individual PDF pages - with names
              rob day Adobe Community Professional & MVP

              See if this works. I'm assuming you have a text frame on the master page for the data merge name, which you want to use as the page's PDF title. If you select the frame on the master, and open the Script Label panel (Window>Utilities), you can give the frame a label. Keep in mind the script label will not be applied to existing pages where the frame has been overridden:

               

              Screen Shot 2014-06-23 at 3.27.35 PM.png

              Here's the script that exports PDF pages using the contents of the labeled text field as the title.If there are no text fields on a page with the MyName label the page number is used as the title instead:

               

               

              --the text field's label. This must match the text frame's label exactly.

              set targetlabel to "MyName"

               

              tell application "Adobe InDesign CS6"

                  activate

                 

                  --prevent PDF's from opening as they are created

                  set view PDF of PDF export preferences to false

                 

                  -------------------------------Export preset dialog----------------------------------

                 

                  --check for an active document

                  if (count documents) is equal to 0 then

                      display dialog "Please open a document" buttons " OK " default button 1 with icon caution

                      return -128

                  end if

                 

                  --the doc name for naming PDFs

                  set myFileName to name of active document

                 

                  --PDF preset choice dialog.

                  set myLabelWidth to 250

                  set myDialog to make dialog with properties {name:"Export Preset"}

                  tell myDialog

                      tell (make dialog column)

                          tell (make border panel)

                              tell (make dialog column)

                                  tell (make dialog row)

                                      set PresertList to name of every PDF export preset of application "Adobe InDesign CS6"

                                      make static text with properties {static label:"PDF Preset:"}

                                      set myPDFPresetDropdown to make dropdown with properties {string list:PresertList, selected index:4, min width:myLabelWidth}

                                  end tell

                                 

                              end tell

                          end tell

                      end tell

                  end tell

                 

                  --get the results

                  set myResult to show myDialog

                  if myResult = true then

                      set myPDFPreset to item ((selected index of myPDFPresetDropdown) + 1) of PresertList as item

                  else

                      return

                  end if

                  destroy myDialog

                 

                  -------------------------------export PDFs----------------------------------

                 

                  --choose the folder for exported PDFs

                  set myFolder to (choose folder with prompt "Please select an Export Destination") as string

                 

                  tell active document

                      set NumberOfPage to pages per document of document preferences

                     

                      with timeout of 5000 seconds

                          repeat with x from 1 to NumberOfPage

                             

                              --set the contents of the labeled doc as the PDF's name

                              --if there is no labeled text field use the page number

                              try

                                  set pdftitle to (contents of every text frame of page x whose label = targetlabel)

                              on error

                                  set pdftitle to x as string

                              end try

                             

                              set thePath to (myFolder & pdftitle & ".pdf")

                             

                              --Set the page range, the tell has to be to ID

                              tell application "Adobe InDesign CS6"

                                  set page range of PDF export preferences to (x as string)

                                  export document 1 format PDF type to thePath using PDF export preset myPDFPreset

                              end tell

                          end repeat

                      end timeout

                  end tell

                  display dialog "Pages have been exported."

              end tell

              • 7. Re: Multi paged document into individual PDF pages - with names
                bingandham Level 1

                I've never used a script. Do I just cut an paste this into a txt file and place in the scripts folder?

                • 8. Re: Multi paged document into individual PDF pages - with names
                  rob day Adobe Community Professional & MVP

                  No, you have to paste the text into ScriptEditor and compile it.

                   

                  Here's a zip archive with a complied version (ExportPDFByLabel.scpt). Just copy the script into your scripts folder (Applications/Adobe InDesign CC/Scripts/Scripts Panel). You run a script by double-clicking it from the scripts panel.

                   

                  I've included the ID file I used to test, if you select the text field on the master page you'll see the label in the Scripts Label panel. When you run the script it asks for a destination folder for the PDFs

                   

                  http://www.zenodesign.com/forum/ExportPDFLabel.zip

                  • 9. Re: Multi paged document into individual PDF pages - with names
                    bingandham Level 1

                    That worked perfect! Thanks so much!