PDF Image Adder
This adapter adds one or more graphics to an existing non-protected PDF document or creates a new PDF document with the specified graphics. These can be specified both as a URL and as a Base64-encoded string.
Supported graphic formats are BMP, GIF, JPEG/JPG, PNG and TIFF. The graphics can be positioned, scaled and rotated on each PDF page. The information about the graphics is stored in an adapter-specific input XML document. The adapter outputs either a new PDF document or a PDF document to which the specified graphics have been added.
As of adapter version 2.0.0, the EPS and WMF graphic formats are no longer supported.
If the input document does not contain a PDF element, a PDF document in DIN A4 format with the defined number of pages is first created before the graphics are added.
Properties
Operation | Determines which operation the adapter executes Possible values: |
Parameters
Adapter | Main class of the adapter (do not change!) Possible values: en.softproject.integration.adapter.pdf.PDFImage: Main class (default) |
ReadPartially | Load PDF document into memory in multiple parts (can improve the performance) Possible values:
|
toXML | Output PDF document Base64-encoded in an XML document Possible values:
|
Status values
1 | The operation was executed successfully. |
-1 | The operation failed due to a technical error. |
Input
This adapter expects an adapter-specific input XML structure in which information about each graphic is stored. This includes width and height (in cm
or pt
), rotation, x- and y-position (distances from the lower left page margin in cm
or pt
), the URL to the graphic as well as the page on which the graphic is to be positioned. The input PDF document can be specified either as a URL or as a Base64-encoded string.
<pdfImage>
<!-- <PDF url="xstore URL of the input PDF document in the repository" (if input PDF is specified as URL) /> -->
<!-- <PDF encoding="base64"> Base64 character string (If input PDF has Base64 character string)</PDF> -->
<Image height="Height" width="Width"
rad="Rotation (radians)" degree="Rotation (degrees)"
xPos="Distance from left margin" yPos="Distance from bottom margin"
url="xstore URL of the graphic in the repository" page="Page in PDF"/>
</pdfImage>
The following input XML document contains information for a PNG image file to be inserted on the first page of an existing PDF document (specified as URL or Base64 string).
<pdfImage>
<!-- <PDF url="xstore://Project/Folder/InputPDF.pdf"/> -->
<!-- <PDF encoding="base64">base_64_encoded_PDF_document</PDF> -->
<Image height="90pt" width="60pt" rad="" degree=""
xPos="400pt" yPos="100pt"
url="xstore://Project/Folder/Image.png" page="1"/>
</pdfImage>
The following input XML document contains information for three graphics that are to be merged into a new PDF document.
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<Image page="1" height="100pt" xPos="10pt" yPos="500pt" url="https://www.softproject.de/assets/images/a/Logo-SoftProject_www-ee6b7fba.png"/>
<Image page="3" height="100pt" xPos="10pt" yPos="500pt" url="https://www.softproject.de/assets/images/a/Logo-SoftProject_www-ee6b7fba.png"/>
<Image page="3" height="120pt" xPos="50pt" yPos="100pt" encoding="base64">
iVBORw0KGgoAAAANSUhEUgAAAEsAAAAWCAYAAACIXmHDAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAHDSURBVFhH7ZSxSgNBEIZ9gjyZjS/hY9jbiJW9rWBlaWNpqVUqEQRBwSBRE4gxWf3X/MfvuHvcbO66HfjZy+zO7Mx3k9t53huFqm6qsByqsByqsByqsBz6B+v1YDesJo9hvVyEj7PDxj+/PA0wrHp+erwf1vP3KDzrnu6nbPkwbvKq6d2L26uN99e4h9iU4a7Z+VHswRpiNCd/U/AjDgzUTyUniw0ykABtcohF52CpUEzXl5DaQx1fT/d/4vGMnMhNH+vNNU5YtpYiWBATYoVSMNAE/Mu7m0Fgpc5blcJaTV+idACivwQWL6TZZjh98MemBpysttzFsH72ZhcnMTfrKYYFsdhUArwR+vuApaa5EENL3dEGyxrPYGXt6IPTpX7mUnWClWpQfbhkW1hY9azKNq9n22DlGlcoMX4zXcWw0DiS8HukSfhRT5l+A6xKYVEEo7VsCwu/+S/5HF9nY6AsLCZAIJK3NRQhDDhZKtSld/UBq3kJbxM/LAazAV6eAzIULJzXSW2mXXx9wIKQE+aClSoIYlPWD/UByxr8OG9NoUBtsKwRBM5aKMzjglWVV4XlUIXlUIXlUIXlUIXlUIXVWaPwDd5omEQbL+NTAAAAAElFTkSuQmCC</Image>
</Root>