Operation: SetMetadata
The SetMetadata
operation adds metadata to a PDF file or replaces existing metadata.
PDF default metadata
Element | Description |
---|---|
<Author> | Author of the document |
<CreationDate> | the creation date and time |
<Creator> | The original application that created the document |
<Producer> | The product that created the document. |
<Subject> | Subject of the document |
<Title> | Title of the document |
<Keywords> | Keywords Can be separated by commas |
<ModDate> | Date and time of the last change |
You add custom metadata with a custom element. In the following example, a Region
metadata is added with the value Europe
:
<Region>Europe</Region>
Input
PDF in PDF format
The following input XML document contains the path to a PDF document in the repository and the metadata to add.
<?xml version="1.0" encoding="UTF-8"?>
<pdfMetadata>
<PDF url="xstore://_MEINTEST/Resources/input.pdf" />
<Metadata>
<Author>SoftProject GmbH</Author>
<CreationDate>D:20210610111922+02'00'</CreationDate>
<Creator>X4 BPMS</Creator>
<Producer>X4 BPMS</Producer>
<Subject>X4 BPMS Output</Subject>
<Title>Hello World</Title>
<Keywords>keyword1;keyword2;keyword3</Keywords>
<ModDate>D:20210610111922+02'00'</ModDate>
<Region>Europe</Region>
</Metadata>
</pdfMetadata>
PDF in Base64 format
The following input XML document contains the Base64 string and the metadata to be added.
<?xml version="1.0" encoding="UTF-8"?>
<pdfMetadata>
<PDF encoding="base64">
Base64-Zeichenkette
</PDF>
<Metadata>
<Author>SoftProject GmbH</Author>
<CreationDate>D:20210610111922+02'00'</CreationDate>
<Creator>X4 BPMS</Creator>
<Producer>X4 BPMS</Producer>
<Subject>X4 BPMS Output</Subject>
<Title>Hello World</Title>
<Keywords>keyword1;keyword2;keyword3</Keywords>
<ModDate>D:20210610111922+02'00'</ModDate>
<Region>Europe</Region>
</Metadata>
</pdfMetadata>
Output
If the ToXML
parameter is disabled, the output can be saved directly as a buffer file in PDF format.
If the ToXML
parameter is enabled, the output looks like follows:
Output at parameter ToXML: yes
<?xml version="1.0" encoding="UTF-8"?>
<PDF encoding="base64">
Base64-Zeichenkette
</PDF>