7 Replies Latest reply on Mar 21, 2013 6:32 AM by Ren Sukhram

    VDP / Data Merge - Multiple PDF's (1 record / 1 pdf)

    Ren Sukhram Level 1

      Hello all,


      2 part questions (second one I think is more file system related)


      Part 1 - I have created a document in indesign and am using data merge.  The merge works well but the PDF that is created a single pdf file with all my merged pages within it.  I am wondering if there is a way to have mutliple pdf files created.  If my data has 10 rows of information is there a way to run the merge and get 10 single page pdf files?


      **nevermind pt 2...google search just turned up some good hits.**

      Part 2 - If I can get the merge to be single pdfs is there a way to name the file based on a column of my data file?  I am assuming that indesign cannot do this.  I am a pc user and have not found a batch rename software based on variable data content. 


      Thanks in advance


        • 1. Re: VDP / Data Merge - Multiple PDF's (1 record / 1 pdf)

          If it is only 10 records. I would open the pdf and create an action to extract pages in Acrobat then save as the name of the column accordingly. If it is hundreds or thousands, the method I have described is very extensive.You can also merge the data in InDesign and then export it after the merge to many file types, JPG or PNG to name a couple. I know JPG will export to a single file per each page. You would then have to rename them per each column

          1 person found this helpful
          • 2. Re: VDP / Data Merge - Multiple PDF's (1 record / 1 pdf)
            Colin Flashman Adobe Community Professional

            This can be done with an ACROBAT javascript. The catch is that 1 record = 1  page.


            Go to this post on the Adobe forums:  http://forums.adobe.com/message/4633533#4633533 - read his post prior to the script carefully.


            Copy the script in the 8th post by GrahamHe and make an action using the action wizard. If the error "Number of pages & CSV row count inconsistent" keeps appearing, make the change on line 2 and change


            var _data = data.split('\r\n');




            var _data = data.split('\r');


            Be careful that the entries in the column name are unique (such as a primary key) otherwise the resulting PDFs may overwrite.



            1 person found this helpful
            • 3. Re: VDP / Data Merge - Multiple PDF's (1 record / 1 pdf)
              Ren Sukhram Level 1

              Thanks I actually had to change my workflow since then but your response was helpful.   There is an easier way. 


              Part 1 - splitting a multiple page pdf to single page pdfs:

              - using acrobat X go to pages>extract

              - check off "extract pages as seperate files

              - choose your location and done

              the naming convention will be the name of the initial file followed by a number (in sequence).


              In regards to renaming the file I use Excel and found a macro that changes an original file name+extension to a revised file name+extension.

              If anyone would like to know the process let me know.

              • 4. Re: VDP / Data Merge - Multiple PDF's (1 record / 1 pdf)
                Colin Flashman Adobe Community Professional

                It is always good to have different ways of accomplishing the same task so if you are able to know your process of renaming the files, that would be appreciated.

                1 person found this helpful
                • 5. Re: VDP / Data Merge - Multiple PDF's (1 record / 1 pdf)
                  Ren Sukhram Level 1

                  ok so to better understand why I did it this way I will explain the situation.  I work for a copier reseller and we carry many models.  My goal is to re-brand our sample files and include as a footer the following information (filename / machine printed on / paper stock printed on).  This method initally seemed like the right approach using variable data but I have changed my thoght since then and decided to used the combo box interactive filed which would eliminate the need for 50+ pdfs per sample.


                  My steps tho prior to changing my mind was as follows.


                  Variable Data Merge:

                  create my indesign doc and setup the data merge.

                  my data file had field for filename (which was part static and part dynamic), machine model and paper stocks.

                  exported the pdf (which is a single PDF with multiple pages)


                  Splitting the PDF to single page PDFs:

                  Open the multiple page PDF in Acrobat X and use the extract feature tools>pages

                  Select your location and the newly created single page PDF will created files using the following naming convention (original filename 1.pdf, original filename 2. pdf, etc....)


                  Renaming the PDF's

                  Since indesign uses row order from the data file to create the pages the multiple page PDF also has the same order as my data file.  When I split the pages using the extract function the number scheme used my acrobat kept the files in order also (page 1 was file1, page 2 was file 2, etc....)

                  Using my inital data file (with my filenames that I have merged onto the indesign file) I created another spreadsheet copying the filenames onto a column (column B).

                  Column A consist of the filenames that the extract tool created (note that the file xtension needs to be listed also for both column A & B, in this case .pdf)

                  In Excel go to VBA (alt+F11).  Goto insert>module.


                  paste this code:

                  Sub ChangeNames()

                  Const FILEPATH = "C:\Users\rsukhr01\Desktop\test"  'amend to location containing files

                  Dim r As Range, cell As Range


                  'identify range containing file names - assumes you hve a header in row 1 and then filenames below it

                  Set r = ActiveSheet.Range("A2:A" & Cells(Rows.Count, "A").End(xlUp).Row)


                  'loop thru the files and change their names:


                  For Each cell In r

                    Name FILEPATH & "\" & cell.Value As FILEPATH & "\" & cell.Offset(, 1).Value

                  Next cell


                  End Sub


                  Close VBA, goto view>macros and run the "change.name" macro.

                  This will rename the original file names (column A) to your new file names (column B).  Also make sure this excel file is is the same folder as your files that you want to rename.



                  hope this helps...

                  also I will find out the source for the VBA macro and update to give that person credit.

                  • 6. Re: VDP / Data Merge - Multiple PDF's (1 record / 1 pdf)
                    Colin Flashman Adobe Community Professional

                    Funny how many solutions come out of the woodwork at once. This one is via French scripter Loic Aigon with a script for the purpose. He details how on his blog: http://www.loicaigon.com/en/pdf-exports-properly-named/


                    In summary, it involves merging to a new indesign file first though. once the merged file is made, the script can be run that will allow other variables for the name to be entered.


                    Again, always great to have several options to complete the same task.

                    1 person found this helpful
                    • 7. Re: VDP / Data Merge - Multiple PDF's (1 record / 1 pdf)
                      Ren Sukhram Level 1

                      interesting script.  From what I am reading on his page this is being ran thru in-design?


                      I will have to give this a shot.  thanks for the share.  much less steps than me using 3 apps.