Data Merge from InDesign to unique filenames – now a reality

Ever since I published the article “Breaking up is hard to do… InDesign files into individual PDFs that is!” on Colecandoo, it has been one of the most searched for and popular stories on this site.

I have also written two articles for InDesignSecrets particularly relating to Data Merge and unique filenames: Data Merging Individual Records to Separate PDFs and Data Merging Individual Records to Separate PDFs Part 2: via Scripting. While these methods work, I felt that there had to be a better way to accomplish the task.

Since returning from PEPCON 2015, I have been busy creating a javascript solution to the problem. The script is now at a stage where I am pleased with the results and would like to begin beta testing the script.

nothingselectedThe script is a user interface that is designed to work when ready to merge the records. The script:

  • Merges to uniquely named PDF or InDesign files;
  • Uses information from csv or txt in the Data Merge to create the filenames;
  • Creates web-safe filenames;
  • Provides warnings about duplicate filenames, missing images or overset text;
  • Can merge one record, a range, or all records in the database

Here are some more screenshots of the script:

resultsbadduplicatefinishedIf you are interested in trying the beta of this script, it can be downloaded from the Downloads page.

Advertisements

About colmin8r
A prepress operator since 1997 specialising in Adobe InDesign.

18 Responses to Data Merge from InDesign to unique filenames – now a reality

  1. Pingback: Breaking up is hard to do… InDesign files into individual PDFs that is! | Colecandoo!

  2. Pingback: A Data Merge Script for Outputting to Individual Files | InDesignSecrets

  3. hasanilx2 says:

    Great script, worked well on my laptop. But for whatever reason I can’t get it to work on my desktop. I get the following error “This document has missing fonts. Please fix all missing fonts and try again.”

    But when I do Type > Find Font I do NOT have any missing fonts.

    Please advise.

    THX

    • colmin8r says:

      I have sent you a private email in order to try and debug this issue rather than try various methods over the posting system. Please repost if you have not received this email.

      • I have this same issue…

  4. Joe Tetzel says:

    Love the script, but for some reason all of my exported PDFs have the correct file name according to the field I chose, but the content of all of the exported PDFs contains only data from the first record.

  5. AWESOME script works straight out of the book! Thank you

  6. Hi Colin, Great script. The only problem I have with it is the hyperlinks in the outputted files don’t work. Any ideas?

    • colmin8r says:

      This is a feature of the PDF export directly from Data Merge – nothing to do with the script, but a part of how InDesign’s scripting DOM handles PDF export from Data Merge. It is one of the questions in the questions and answers provided in the instructions on page 15 of the instructions that are supplied with the script. It reads:

      In my PDF export options, I had the spreads radio button on, but the script has output single pages. Why?
      Just as there is a difference between PDF export options for print and interactive outputs, there is also a difference between the options for print and Data Merge, but they are far more subtle.
      The screen capture on the right hand side demonstrates the general options available when exporting to PDF via Data Merge, but note that several options are greyed out:
      The page range (not the record range)
      Spreads
      Create Tagged PDF
      Create Acrobat Layers
      Hyperlinks
      As the options are greyed out, this means these options cannot be chosen for a Data Merge export, whether the script is used or not.

      All is not lost, but it is an added step unfortunately. That is to merge to new InDesign files first, and then use Peter Kahrel’s “batch convert” script to export the PDFs from the newly created ID files en masse.

  7. Alex SV says:

    Hello,

    Perfect script!

    I have the following problem, though:

    All columns from imported CSV (Fields in database) appear in one filed. I cannot add them as separate fields to the right (Add to filename).

    Then, when trying to export, I got:

    “JavaScript Error!
    Error number: 9485
    Error String: Failed to Export the PDF file.

    Engine: main
    File: …/DM_onefileonedatabasetosinglerecordPDF_v1_26.jsxbin
    Line: 667

    I’m using recent version of InDesign CC 2017.0

    • colmin8r says:

      Need to know about the origin of the csv file. Was it from excel originally, and if so, what happens if exporting as a tab delimited file and importing the tab delimited file instead of a csv?

      Is the csv file separated by commas or tabs in the csv file itself? If the file is comma separated but has a txt extension, change the extension to csv. Likewise, if the file is tab separated but has a csv extension, change the extension to csv.

      I would like to try and replicate the fault here. Can you please send me the data file (or even just the first ten lines) plus your indd file? Send it to colin (at) colecandoo (dot) com.

  8. Alex SV says:

    Hello,

    Thank you very much for your help.

    Actually, I managed to export the PDFs (more than 1500, by the way, without crashes).

    The script worked when data is eported in TAB delimited TXT file, as you suggested.

  9. Great script! It worked well for me.
    However, when I tried to export PDF files that contained a form text field, the text field would not display. Is there a way to change the export function so that text fields can be included?

    • colmin8r says:

      I agree, this would be a great feature. Unfortunately, the script is simply automating the naming feature of the task of Data Merge itself, and that only allows for export to InDesign or PDF for print. In fact, the PDF for print from Data Merge differs from regular PDF for print in that several options are not able to be selected. I wrote about that at the end of 2016 here: https://colecandoo.com/2016/12/17/data-merge-pdf-export-vs-regular-pdf-export/

      In the meantime, there is a workaround solution to what you would like and it is in the link posted in the previous paragraph.

  10. Thank you very much Colin. You’re article was spot on – exactly what I was trying to accomplish. The workaround was a good solution. I also took your advice and submitted my thoughts/feature request to the Adobe InDesign team.

  11. Hi,

    I need to export the results of my merge as transparent png files with file names from my data. Your script is so close… Any idea how I solve my problem?

    Keep up the great work!

    Wyatt

    • colmin8r says:

      I may be able to edit a script I have in development – if you have a look at the following youtube video https://youtu.be/aVD-uHGQ4Q8 there is a script that exports to interactive PDF instead of PDF/INDD that ID normally forces data merge to make. I can adjust it so that it would export to PNG… but I would charge for this script. Is this a solution you would be prepared to contribute a donation for?

      • mikeschweizer says:

        I certainly would. The option to save as a .png or a .jpg would be fantastic, and the ability to add dimensions automatically to the filename would be a plus.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: