· data2print ·

The solution for preparing, composing and personalizing
complex printed matter

Startpage · Introduction · Input/Processing/Output · Examples

Rearrange existing PDF documents
PDF document in individual pages
Split PDF document into front pages/back pages
Extract specific PDF pages
Extract specific PDF front/back pages

Composition of multiple PDF documents
Combine PDF documents
Scale PDF document
Duplicate PDF document on print sheet

Change existing PDF documents
Create multi-page mail merge
Resort PDF documents

 

Example – Create a multi-page form letter

A mail merge from addresses in a CSV file is extremely easy to create. The first page of an existing document is expanded to include address data, the remaining pages are added without changes. The generated PDF file contains all personalized documents.

data2print does not simply copy the source document - the unpersonalized document is only copied once into the personalized target file and is only referenced at the following addresses. This keeps the target file small and print RIP time minimal.

<?xml version="1.0" encoding="utf-8"?>
<job>
  <dialog>
    <topic>
      <prompt>PDF-Inputfile</prompt>
      <type>file</type>
      <filter>'.pdf'</filter>
      <variable>inFile</variable>
    </topic>
    <topic>
      <prompt>Adressdatei</prompt>
      <type>file</type>
      <filter>'.csv'</filter>
      <variable>csvFile</variable>
    </topic>
  </dialog>

  <eval variable="outFile" expression="filepath({inFile}+'adressen.pdf'" />
  <instance>
    <iterate file="{csvFile}" variable="adr">
      <iterate file="{inFile}" variable="pdfin">
        <append>
          <template file="{inFile}"  pagenr="{pdfin.pagenr}"/>
          <compose condition="{pdfin.pagenr}=1" file="addressfield.compose.xml"/>
          <output file="{outFile}"/>
        </append>         
      </iterate>
    </iterate>
  </instance>
</job>
 


Open selection window

Description field in the selection window

Allow a PDF file
Remember selected file name




Allow a CSV address file
Remember selected file name



Add “_adressen.pdf” to the output file

Going through the address lines
Cycle through the pages of the document
Append to the specified output file
Attach current page only
Only insert the address in position on page 1
Write to the personalized destination file

End of document page loop
End of address loop

The address field is described separately in the file "addressfield.compose.xml", but can also be located in a form field within the PDF document to be personalized.

<?xml version="1.0" encoding="utf-8"?>
<compose>

  <field type="document" top="6cm" left="3cm"
                         height="3.5cm" weight="6cm">
    <halign>left</halign>
    <valign>top</valign>
    <text fontface="arial" 
          fontsize="10pt"
          fontcolor="black"
          trim="words,lines"
          ignore="empty">
      <p>{adr.Firma}</p>
      <p>{adr.Anrede} {adr.Titel} {adr.Vorn} {adr.Nachn}</p>
      <p>{adr.Straße} {adr.Hausnummer}</p>
      <p>{adr.PLZ} {adr.Ort}</p>
    </text>
  </field>

</compose>
 



Location of the address






Double spaces are deleted
Empty lines are deleted
The data fields {adr.xxxxx} receive the name from the CSV file