Skip to main content
Participant
December 12, 2008
Question

InDesign export to single PDF files with variable Filename

  • December 12, 2008
  • 2 replies
  • 7827 views
Hi there,<br /><br />I create a document with Data Merge which contains about 200 Pages. Now i want to export each page to a single PDF-File. Also the filename has to be generated from the placed content. The placed content are adresses. So i want to generate a filename with a static name. I got an ID, a static phrase and then a ZIP-Code. The Filename should look like this: <ID>September<ZIP Code>.pdf while ID and ZIP Code are fields from the datamerge.
This topic has been closed for replies.

2 replies

_salbe_Author
Participant
December 12, 2008
Hey thanks a lot, is it possible to get the text while using character styles?
Loic.Aigon
Legend
December 12, 2008
what you need is to operate throuh a loop.<br />for(i=0; i<app.activeDocument.pages.length;i++)<br />{<br /> //Assuming you labelled the textframe containing the ID with ID<br /> var myID = app.activeDocument.pages.textFrames.item("ID").contents;<br />//Assuming you labelled the textframe containing the ZIP with ZIP<br /> var myZip = app.activeDocument.pages.textFrames.item("ZIP").contents;<br /><br />var myPath = //something like "/disk/folder/" //Set a path to where you want to export the pdf<br />var myFileName = myID + myPath + myZip + ".pdf";<br />//Export to PDF - the forum is full of examples, you should find easily what you are asking for with search<br />} <br /><br />Loic