Skip to main content
Skip table of contents

PDF Barcode Adder

This adapter creates barcodes and adds them to an existing non-protected PDF document. The barcode graphics can be positioned, scaled and rotated on any PDF page. The barcode types Code 39, Code 128, Codabar, EAN 13, Code 25-Interleaved 2 of 5 and POSTNET are supported.

The barcode data is stored in an adapter-specific input XML document. The adapter outputs a PDF document that has been supplemented with the specified barcodes.

Properties

Operation

Determines which operation the adapter executes

Possible values: AddBarcodes: Add barcode(s) to the PDF document

Parameter

Adapter

Main class of the adapter (do not change!)

Possible values: en.softproject.integration.adapter.pdf.PDFBarcode: Main class (default)

ReadPartially

Load PDF document into memory in multiple parts (can improve the performance)

Possible values:

  • yes: Load in several parts one after the other into the working memory

  • no: Load PDF document in one piece into the working memory (default)

toXML

Output PDF document Base64-encoded in an XML document

Possible values:

  • yes: Output XML document

  • no: Output PDF document as binary data stream (default).

Status values

1The operation was executed successfully.
0

The operation was executed successfully, but without any result.

-1The operation failed due to a technical error.

Input

This adapter expects an adapter-specific input XML structure in which all data of each barcode graphic is stored (see below). If a PDF from the repository is to be used as the source document, specify its xstore URL in the url attribute in element <PDF>. Alternatively, if the source document is available as a base64-encoded string, you can store this string as the content of the element <PDF encoding="base64"> (see commented out line).

HTML/XML
<pdfBarcode>
   <PDF url="xstore URL of the input PDF document in the repository"/>
   <!-- <PDF encoding="base64">(If input PDF is Base64 string)</PDF> -->
   <barcode height="Height" width="Width" 
   rad="Rotation (radians)" degree="Rotation (degrees)"
   xPos="Distance from left margin" yPos="Distance from bottom margin" 
   type="Barcode type" page="Page">Barcode data</barcode>
</pdfBarcode>

Attributes in the input XML document

The PDF Barcode Adder expects an adapter-specific input XML structure according to the above pattern. The following attributes can be set:


url

xstore path specification to the input PDF document in the repository (e.g. xstore://Project/Data/InputData.xml; required).

height

Height of barcode graphic in cm or pt (required)

width

Width of the barcode graphic in cm or pt (required)

rad

Rotation of the barcode graphic in radians

degree

Rotation of the barcode graphic in degrees (required)

xPos

Distance of barcode graphic from left margin in cm or pt (required)

yPos

Distance of the barcode graphic from the bottom of the page in cm or pt (required)

type

Barcode type (required)

Possible values:

  • 39: Code 39 -Format

  • 128: Code 128 -Format

  • Codabar: Codabar -Format

  • EAN: EAN 13 -Format

  • Inter25: Code 25 – Interleaved 2 of 5 -Format

  • Postnet: POSTNET -Format

page

Page number in the PDF document on which the barcode graphic will be positioned (required).

Example

The following input XML document contains the data to create an EAN 13 barcode graphic with 3 cm width and 20° slope on the first page of a PDF document in the repository.


HTML/XML
<pdfBarcode>
   <PDF url="xstore://Project/Folder/InputPDF.pdf"/>
   <!-- <PDF encoding="base64">base_64_encoded_PDF_document</PDF> -->
   <Barcode height="3cm" width="3cm" rad="" degree="20" 
         xPos="120pt" yPos="1cm" type="EAN" 
         page="1">1234567891234</Barcode>
</pdfBarcode>
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.