· 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 – Duplicate PDF document on print sheet

A DIN A4 PDF document is arranged duplicated on an A3 printed sheet in order to save printing costs if necessary.

Although this process visually duplicates the PDF file, the optimization does not make the original file twice as large. Current RIPs also do not charge pages twice.

<?xml version="1.0" encoding="utf-8"?>
<job>
  <dialog>
    <topic>
      <prompt>PDF-Inputfile A4 (wird dupliziert)</prompt>
      <type>file</type>
      <filter>'.pdf'</filter>
      <variable>inFile</variable>
    </topic>
  </dialog>

  <moulds>
    <mould name="2x1mould">
      <width>21cm*2</width>
      <height>29.7cm</height>
      <row>
        <cell name="A1">
          <width>21cm</width>
          <height>29.7cm</height>
        </cell>
        <cell name="B1">
          <width>21cm</width>
          <height>29.7cm</height>
        </cell>
      </row>
    </mould>
  </moulds>

  <eval variable="outFile" expression="filepath({inFile}+'dupliziert.pdf'" />

  <instance>
    <iterate file="{inFile}" variable="pdfin">
      <append>
        <template mould="2x1mould"/>
        <compose file="duplicated.compose.xml"/>
        <output file="{outFile}"/>
        <eval variable="inFile" expression="{inFile}" />
        <eval variable="pageNr"  expression="{pdfin.pagenr}" />
      </append>         
    </iterate>
  </instance>
</job>
 


Open selection window

Description field in the selection window

Only allow PDF files
Remember selected file name



Calculate the pressure range

Total width
Total height

left print area



right print area



End of line with print areas



Name output file


Cycle through the selected file
Append page to output file
Take a defined pressure area
Where something should be positioned
Specify output file
Transfer input file
Transfer current page number

End of program loop

The appropriate compose file "duplicated.compose.xml", where something should be positioned. Since the left and right halves of the print sheet are the same, the output areas receive identical content.

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

    <field label="links" type="pdf" mould="2x1mould.A1">
      <file>{inFile}</file>
      <page>{pageNr}</page>
      <halign>center</halign>
      <valign>middle</valign>
    </field>    
        
    <field label="rechts" type="pdf" mould="2x1mould.B1">
      <file>{inFile}</file>
      <page>{pageNr}</page>
      <halign>center</halign>
      <valign>middle</valign>
    </field>
    
</compose>
 




PDF input file
Just take this current page





PDF input file
Take the same current page here too