7 Replies Latest reply on Jul 21, 2015 5:10 AM by Colin Flashman

    Data Merge (ID) then Split Documents with Filename

    wflex Level 1

      Hey everyone,


      I'm using InDesign and Data Merge to create business cards for our printer, but we of course have the recepients proof them first.


      I was wondering if there was a way where after the Data Merge, I could separate every 2 pages into their own PDF (front and back of card).


      Even more awesome would be if the PDF filename could be "<<FirstName>><<LastName>>-BC-proof.pdf"



        • 1. Re: Data Merge (ID) then Split Documents with Filename
          wflex Level 1

          Created this desription for someone looking to help, may clarify:


          So here’s my workflow and goal result for these files.


          I am creating special business cards for a handful of people in our company. And since our print vendor usually handles proofs and approvals per individual, I’ve got to try and replicate that process for this piece.


          I created an InDesign file with the fields I need to populate from a spreadsheet with all their contact information.


          Data Merge works like it should, and my merged document contains the front and back of each card for each individual in the handful of people. But now, I need to send out a copy of each for the recipient to approve.


          Another helper here has been manually splitting the documents and sending them out for approval, but I’d very much like to streamline the process (from merge, to proof, to approval, to printer). And the printer will likely be needing these in separate files for shipping reasons.


          So now that I have a merged document, my goal would be to export every 2 pages with a filename of the “<<LastName>><<FirstName>>-COE_BC_PROOF.pdf” so our helper can get them sent out for approval.


          A second step may be to re-do this process with bleed for the printers (or if that seems too much, the proofs will just include bleed and what not so we can forward them straight to the printer).


          So wadda ya think?

          • 2. Re: Data Merge (ID) then Split Documents with Filename
            Daniel Flavin Level 4

            This needs to be posted in the InDesign forums.

            This will produce two page files - From InDesign's Data Merge panel, Option tab, set the Record Limit Per Document to 2.


            This seems to available for both Export to PDF and Create new Document merge.


            The hurdle is naming the files. I have done more than a few of these and cannot give a simple solution. I have pondered the idea, and my method would invlove something such as...

            If the name is contained in the first text frame, or the first instance of a Character or Paragraph Style you might create an InDesign Script which looks for that instance. The script would pick up the seleted found name and rename with that.

            The hurdles are - Creating a Script. ID's scripting is full featured, but beyond my means to dig into. The ID Scripting forum would be the place to ask.

            ID will the name as <<first>> <<last>> and you might want the file as <<last>> <<first>>  and you possibly have an initial before first and last. (A script might be written to ignore any single character or character followed by a . )


            The string of -COE_BC_PROOF could easily be included.


            My method, and this works better on a PC then a Mac, would be to create the merged file.

            I double click the last name to highlight - ctrl+c to copy - ctrl+e to export - type the page range in the pdf export dialog -

            shft+ctrl+left arrow to highlight the last word of the last export -

            ctrl+v to paste the name in the Save dialog - hit enter, repeat as needed. It goes quickly, my hands move very little.

            • 3. Re: Data Merge (ID) then Split Documents with Filename
              Allta Media Adobe Community Professional

              Is there anyway to create bookmarks from InDesign with the designated Paragraph Style. Then in Acrobat you could use the Split command to split at top level bookmarks using the bookmark as the filename.

              • 4. Re: Data Merge (ID) then Split Documents with Filename
                Colin Flashman Adobe Community Professional

                this thread is active elsewhere: http://forums.adobe.com/message/4994973


                as I said in that thread, try this link for a script that should do what the OP is after



                • 5. Re: Data Merge (ID) then Split Documents with Filename
                  alanomaly Level 1

                  As far as I can tell, the best solution to this (for reasonably small files) is the script on this page:






                  Edit: One big problem on testing - it's absurdly slow for even medium to large files. My document has under 600 records, creating PDFs with just 2 pages each coming in at around 0.7mbs each, yet it takes many many minutes per record. I left it running overnight, on a modern Mac Pro with 6gbs RAM, 2x 2.4 GHz, and coming in the following morning, having left it running for about 14 hours, it's only managed to do 95 of the 600 or so records. Not good!




                  It lets you export chunks of an InDesign file to PDF and set up a naming schema for each one, based on the contents of a paragraph style, character style, GREP etc. So you create a merged INDD, then chop it up into seperate PDFs with this script.


                  There's one major flaw with it, which is that the inbuilt option for multiple-page PDFs unavoidably adds ugly page numbers to the PDF name, e.g. "John Smith p23_to_p25.pdf" which, if the goal is to create PDFs to send by email or as downloads, looks really bad.


                  A workaround for this is to include a hidden text box with your chosen characer/paragraph style and the same Data Merge token on every page, then tick the "Group" option. A bit hacky, but it works.

                  • 6. Re: Data Merge (ID) then Split Documents with Filename
                    alanomaly Level 1

                    I eventually decided that the above script was just too clunky and slow.


                    Instead I improved a script on another thread and posted it as a comment - http://forums.adobe.com/message/5551746#5551746.


                    That script is massively faster - whereas the one above failed to reach 20% even after being left to run overnight, the new script at that link completed all records in less than a minute.


                    It's an Acrobat script to run on a data merged PDF rather than an InDesign script. In my opinion that's also an improvement - in my experience, data-merging PDFs seems to be faster and more reliable than creating indesign files.

                    • 7. Re: Data Merge (ID) then Split Documents with Filename
                      Colin Flashman Adobe Community Professional

                      A better script has made itself known but has one bug that is literally "i'm out of records but i think there are more to go" - read the post here: ID CC2015 (MacOSX 10.9.5) Data Merge splitting script - "Data is out of range"... for the first 99 records?



                      [edits made - had shown off a script that had incorrect syntax and needs to be corrected]