CIB pdf toolbox 2 technical documentation

4. Usecases

4.12. Handling embedded files

Embedded files can be added, deleted or extracted from PDF documents. Additionally the info about them can be extracted.

Extracting info about embedded files

Property

Meaning

Type

EmbeddedFilesInfo

Returns a description of the included embedded files in JSON format.

Get

 

Importing embedded files

Property

Meaning

Type

EmbeddedFilesAdd

A JSON-array of JSON objects, which define, what files should be imported. One JSON object looks like this:

  • File: Input Filename
  • UsedFilename: Filename to be used inside PDF
  • Description: Description of the attachment inside PDF
  • Relationship: A PDF/A3 or PDF 2.0 compliant relationship of the Attachment to the PDF document. Standard relationship types are:
    • Source: shall be used if this file specification is the original source material for the associated content.
    • Data: shall be used if this file specification represents information used to derive a visual presentation – such as for a table or a graph.
    • Alternative: shall be used if this file specification is an alternative representation of content, for example audio.
    • Supplement: shall be used if this file specification represents a supplemental representation of the original source or data that may be more easily consumable (e.g., A MathML version of an equation).
    • EncryptedPayload: shall be used if this file specification is an encrypted payload document that should be displayed to the user if the PDF processor has the cryptographic filter needed to decrypt the document.
    • FormData: shall be used if this file specification is the data associated with the AcroForm of the pdf document.
    • Unspecified: shall be used when the relationship is not known or cannot be described using one of the other values.
  • Mimetype: mimetype of the attachment
  • Memory: Memory input

Except of File or Memory all Keys are optional. In Memory usecase also UsedFilename is mandatory.           

Set

 

Exporting embedded files

Property

Meaning

Type

EmbeddedFilesExtract

A JSON-array of JSON objects, which define, what files should be exported. One JSON object looks like this:

  • File: filename as specified in the pdf
  • OutputFilename: Where the file should be saved to.

Set

 

Deleting embedded files

Property

Meaning

Type

EmbeddedFilesDelete

A JSON-array of JSON objects, which define, what files should be deleted. One JSON object looks like this:

  • File: filename as specified in the pdf

Set