CIB pdf toolbox technical guide (EN)
Site: | CIB eLearning |
Course: | CIB pdf toolbox |
Book: | CIB pdf toolbox technical guide (EN) |
Printed by: | Guest user |
Date: | Friday, 22 November 2024, 10:15 AM |
Table of contents
- 1. Delivery Scope
- 2. Introduction
- 3. CIB pdf toolbox as a construction kit
- 4. Possibilities of form use
- 5. PDF/A conversation
- 6. PDF signature with certificate
- 7. Passwords and encryption with PDFs
- 8. Retrieving PDF information
- 9. Adding and removing bookmarks
- 10. Extract barcode information from PDF
- 11. Supported graphic formats
- 12. Technical interfaces
- 13. Generally valid Properties
- 14. Internal modules in detail
- 15. Stationary function, overly of texts, graphics and barcodes
- 16. CIB ocr
- 17. Using test templates
- 18. Quick start
- 19. Programm return codes
- 20. Trace
1. Delivery Scope
GeneralCIB runshell
JAVA Capsule with JCoMod
CIB documentServer
General
Component |
Software scope |
|
CIB pdf toolbox
|
CibPdf32(64).dll CibPdf32(64).lib CibPdf32(64).h CibDataCsv(64).dll CibDataXml(64).dll CIBxalan(64).dll Xalan-C_1_5_0.dll xerces-c_2_2_0.dll cibjbig232(64).dll libcibpdfux(64).so libcibpdfux(64).sl |
CIB pdf toolbox-DLL for Win, interface for application Library for the CIB pdf toolbox Include Datei for the CIB pdf toolbox Access Dll for CSV files Access Dll für XML files Tool Dll for XML Tool Dll XML Tool Dll XML Tool Dll for JBIG2 images CIB pdf toolbox shared library for diverse Unix Systems CIB pdf toolbox shared library for HP Unix Systems |
Dependend Libraries on Linux/Unix |
||
libgcc_s.so libstdc++.so.6 |
||
Dependend Libraries on AIX |
||
libgcc_s.a libstdc++.a |
The scope of delivery also includes help and application examples.
Hint for the modules:
Adobe interactive forms based on Adobe XML Forms Architecture (XFA) are
supportet from PDF 1.5 onwards. With XFA, the information about the form fields
is contained in a XML data stream. This means that additional modules are
required when using the CIB pdf toolbox. These modules are explained in detail
below.
Cibcache.dll optional used for the cache from queries with CibDataXml.dll.
CibDataCsv.dll required if input data of CIB pdf merge has CSV format.
CibDataXml.dll required if input data of CIB pdf merge has XML format.
Cibxalan.dll required if input data of CIB pdf merge has XFDF format or if the PDF contains XFA obejcts.
xalan-c_1_5_0.dll required if CIBDataXml.dll or Cibxalan.dll is used.
xerces-c_2_2_0.dll required if CIBDataXml.dll or Cibxalan.dll is used.
Jbig2dec.dll required if the PDF contains images in JBIG2 format.
The CIB pdf toolbox is available for the following, additional platforms:
- Linux
- SUN Solaris
- IBM Aix
- HP Ux
- Linux für OS/390
- Further plattforms on request
CIB runshell
CIB runshell enables direct usage of CIB pdf toolbox components (DLL), so that PDF files can be processed.
Calling the cibrsh.exe works as follows:
cibrsh.exe –f <additional argument> <PDF file> [<PDF files>]
Here is an example of a CIB pdf join call:
cibrsh.exe –fj file1.pdf file2.pdf
JAVA Capsule with JCoMod
In addition, there is a complete JAVA/JNI encapsulation with the JCoMod Wrapper which allowes easy usage of the CIB pdf toolbox from JAVA.
There are also corresponding JAVA classes for the encapsulation of the CIB runshell, so that the CIB component is not used directly in the process space of the JAVA VM, but in a separate process below it.
There are also corresponding JAVA classes for the encapsulation of CIB runshell, so that the CIB component is not used directly in the process space of the JAVA VM, but in a separate process below it.
CIB documentServer
For using the CIB pdf toolbox in a J2EE container.
2. Introduction
The CIB pdf toolbox is also suitable for subsequent use following a CIB format/pdf conversion, e.g. to process further original PDF files (attachments etc.) with the generated conversion result to a final PDF output file.
This documentation gives a quick overview of the diverse possibilities of use.
3. CIB pdf toolbox as a construction kit
GeneralCIB pdf merge
CIB pdf join
CIB pdf overlay
CIB pdf linearized
CIB pdf print
CIB pdf split
CIB pdf interpreter
CIB pdf format
General
The CIB pdf toolbox is a universal toolbox for processing PDF files. The individual tools are subdivided according to the focus of the functions.
The user has access to the entire functional range of the CIB pdf toolbox.
All functions of the CIB pdf toolbox support extended PDF features such as encryption and web optimization.CIB pdf merge
With CIB pdf merge it is possible to:
- merge data from external XML, XFDF and CSV data sources into a PDF. Form fields contained in the PDF document are addressed by their unique name and are filled with the given content. Due to the ability to process datasets, it supports both single letter and serial letter functionality.
- retrieve or/and set data of invividual fields via direct API interface using programm code.
- control, if filled form fields can be edited afterwards or remain readable only.
CIB pdf join
With CIB pdf join it is possible to combine single PDF files/components to one. It is also possible with encrypted (condition: owner password is known for each file) PDF files.
CIB pdf overlay
With CIB pdf overlay, various objects (e.g. graphics, text) can be stamped onto a page by indicating their position. A detailed description of this tool can be found in the chapter "Letterhead function, overlay of text, graphics and barcodes".
CIB pdf linearized
With CIB pdf linearized, PDFs can be saved web-optimized and the pages to be displayed with priority can be favored.
This is of particular interest especially during internet downloads in order to enable the viewer to display the pages quickly.CIB pdf print
With CIB pdf print Interpreter from the CIB pdf toolbox, a PDF file can be printed directly. Optionally, an interface for interactive printer selection and further print properties is available.
It is also possible to display PDF files in the print preview/page preview module CIB view/jView and print them from there.
Additionally, there is the possibility to edit PDF form fields from the CIB view&form module.CIB pdf split
With CIB pdf split Interpreter, a PDF file can be split into several PDF documents according to certain criteria (e.g. page ranges).CIB pdf interpreter
The PDF Interpreter included in the CIB pdf toolbox provides important detailed information about PDF files, especially for third-party manufacturers of PDF interfaces/tools.
CIB pdf format
The CIB pdf toolbox also allows reformatting of loaded PDFs to modified structures, e.g. into PDF/A.
4. Possibilities of form use
The CIB pdf toolbox offers ideal possibilities for PDF form management.
For merging user data into existing PDF forms, CIB pdf merge is the appropriate solution. The support of a web-optimized and/or encrypted output is self-evident.
For PDF documents without form fields, variable data, additional texts, graphics or form fields can be placed on the desired position for subsequent interactive filling using CIB pdf overlay.
This covers basically all options of filling a form with data.
In addition, there is the possibility to make evaluations about the fields of a form.
You can use the CIB pdf toolbox to:
- retrieve all included form fields
- retrieve all field types of a form ("Button", "Check", "Radio", "Text", "List", "Combo") and also recognize unknown types (e.g. signature)
- retrieve the content of a field
- for radio buttons and checkboxes it is the statename (export value)
- for text fields it is the text
- for list boxes it is the selected value. If there are multiple selections the values are separated by a ; symbol
- for combo boxes it is the value appearing in the edit field
- retrieve additional values
- for checkboxes, radio buttons, list boxes and combo boxes: a list of possible values, separated by a ; symbol
- retrieve additional field options
- currently only „MaxLen=<Length>“ for text
fields with MaxLen>0
In combination with the interface modules CIB view, CIB image or jView it is possible to fill in, save and print PDF forms interactively as long as the fields are not locked for editing.
Direct (silent) PDF print is also supported with these components.4.1. PDF documents with XFA form data
PDF documents can also contain the form fields and their contents as XFA data. The processing of these data is possible from CIB pdf toolbox version 1.4.89 onwards.
The PDF specification 1.5 introduced support for interactive forms based on the XML architecture in PDF. XFA (XML Forms Architecture) contains the information about the form in a XML data stream. This is essentially about the form fields (calculations, validations, formatting) and the associated data. XFA was developed by the Canadian company JetForm. Adobe acquired JetForm and introduced XFA into its PDF specification and Acrobat versions 6 and 7 are based on it.
When processing XFA form fields, CIB pdf toolbox converts this information into a regular PDF form field. The XFA data will be deleted. Information that has no equivalent in PDF will be lost, e.g. numeric or date format.4.2. How does the CIB pdf toolbox behave with multiple forms?
If you want to process multiple PDF forms with
one CIB pdf toolbox function, there may be restrictions depending on the
selected processing step. In this case the following rules apply:
CIB pdf join
When merging multiple PDF forms, it may happen that there are form fields with the same name appearing in several of the source forms. The following rules apply to the generated PDF target form:
- The form fields with the same name have to be of the same field type, otherwise the “join process” terminates unsuccessfully.
- Global properties of a form field (the properties that al fields with the same name have in common) are normally copied from the first document.
Exceptions:
- The property „hide text“ (as in password fields) has priority over the described principle.
- The elements of a list box are extended by the elements of the second document. The same behavior applies to combo boxes.
- Local properties of form fields are maintained.
- Hierarchical refinements of an existing field name are not allowed.
Example: If a document has a form field with the name "Mammal.Whale" and another document a form field with the name "Mammal.Whale.Dolphin" the "join process" of the two documents would be aborted. The reason is that that the most common PDF readers are not designed for this situation.
Important Note:
Basically, the calling application also has the option of prefixing the form fields of each individual form so that when several forms are merged into one large PDF form, so that all fields have a unique field name. See Property: FormfieldNamePrefix
4.3. Removing form fields but keeping the view
It is possible to remove form fields from PDF documents, but keeping the visual "view" of these form fields. To do this, the FlattenFormfields property must be set “1” when “Pdf Join” is called.
Propery description |
Type |
Functionality |
Kind |
FlattenFormfields |
String |
If this property is set "1", the form fields are removed, but the optical "view" of these form fields is maintained. Possible values: „0“: Nothing will be done. (default) „1“: All form fields are removed, but the visual "view" of these form fields is retained. However, only form fields that are also visible on the screen remain visible. For example, if a form field is only visible when printing, it will not be visible after calling FlattenFormfields. Furthermore, all visual effects caused by JavaScript are not visible either. The view after calling "FlattenFormfields" is the same like if viewing with a PDF viewer with deactivated JavaScript. If OutputFormat=FormatText, the content of the form fields is written to the text output. |
Set |
5. PDF/A conversation
With the CIB pdf toolbox PDF files can be converted into the archive format PDF/A. The output formats currently supported are PDF/A-1b, PDF/A-2b and PDF/A-3b.
The desired output format of the PDF/A file to be generated is set via the CIB pdf toolbox property "PdfVersion".
5.1. Recommendations and hints
GeneralForm fields in PDF
PDF/A and encryption
Signatures in PDF/A
PDF content as image in PDF/A
Embedding attachments in PDF/A-3
General
Below are some "best practices" and tips for converting PDF files to PDF/A files.
When creating PDF/A files from existing PDF files, you must always consider which properties of PDF files are permitted by the corresponding PDF/A specification (ISO 19005-1, ISO 19005-2, ISO 19005-3).
Examples:
- When converting to PDF/A-1b and PDF/A-2b, attachments in PDF files are not transferred to PDF/A, they will be removed.
- JavaScript elements inside of PDF files are generally removed.
Form fields in PDF
When converting to PDF/A, the fonts used in the PDF file are embedded in the created PDF/A file. If form fields with content are contained in the PDF file, all of the associated fonts are embedded in the result document. This can increase the file size considerably.
Um In order to embed only the used characters in the associated fonts in the output document, we recommend setting the "FlattenFormfields" property to the value "1". The visual representation of the form fields is retained, the form field itself is removed. For further information, please have a look at chapter Removing form fields but keeping the view.
PDF/A and encryption
When converting to the PDF/A archive format, encryption is generally removed. Further information on encryption and password protection can be found in chapter Passwords and ecryption with PDFs.
Signatures in PDF/A
Currently, signing is only supported for the versions PDF/A-2b and PDF/A-3b. Detailed information about signing PDFs can be found in chapter PDF signature with certificate.
PDF content as image in PDF/A
With the property „ImagePdfCreation“ can be used that the pages of a PDF file to be converted are written to the PDF/A file as graphics via CIB renderer
Hint:
When the pages are embedded as graphics in PDF/A, a text search on these pages is not possible. By additionally setting the “ImagePdfCreationPreserveText” property, it is possible to ensure that text contents that are present in the input file are still transferred to the output file using the HOCR export.
When displayed as a graphic, this also affects the file size of the created PDF/A file. The resolution of the graphics is set to 150 DPI by default. Adjustments are possible via the "TiffResolution" property.
Handling errors with PdfAFallback
In case that elements of a PDF page cannot be converted to PDF/A, an error message is displayed. To create a valid PDF/A document anyway, the "PdfAFallback" property can be set. The property is used to control that in such a case the page concerned is automatically converted into the PDF/A file as an image using the CIB renderer. The possible transfer parameters are listed in chapter Specific options for PDF/A.
Embedding attachments in PDF/A-3
The archive format PDF/A-3 permits embedded files (file attachments). Additional descriptions of the embedded files can be specified using the values of the "EmbeddedFiles" property (see chapter Special options for PDF join).
5.2. Specific Options for PDF/A
Property description |
Type |
Funcionality |
Kind |
PdfAFallback (from CIB pdf toolbox 1.12.0 onwards) |
String |
Controls whether, if an error occurs during PDF/A conversion, the page concerned is automatically converted as an image via CIB renderer. Possible values: „0“ If an error occurs during PDF/A conversion a return value is set (default). „1“ If an error occurs, the corresponding page is converted as a graphic via CIB renderer. |
Set |
PdfVersion |
String |
Setting the PDF version to be generated. Valid values: „PDF/A-1b“ Due to ISO 19005-1 „PDF/A-2b“ Due to ISO 19005-2 „PDF/A-3b“ Due to ISO 19005-3 |
Get/Set |
SkipPageXmpCheck
(from CIB pdf toolbox 1.20.0 onwards) |
String |
This property can be used to control the handling of the XMP metadata present in PDF at page level during PDF/A conversion. Possible values: 0
Default 1 The XMP metadata existing at page level is transferred to the PDF/A output without being checked. In this case, the user is responsible for ensuring that the data is PDF/A compliant. |
Set |
ImagePdfCreationPreserveText (from CIB pdf toolbox 1.21.0 onwards) |
String |
This property can be used to control that in case of a PDF/A fallback (PdfAFallback=1, for details see description of PdfAFallback property), the data will be extracted and embedded in the generated PDF/A. The text content will be extracted from the PDF, converted to HOCR format and embedded as HOCR in the PDF/A file. Possible values: 0
Default 1 Text extraction and embedding in PDF/A |
Set |
6. PDF signature with certificate
(From CIB pdf toolbox Version 1.6.115 onwards)
6.1. General information for PDF signatures
GeneralSigning/verifying with the CIB pdf toolbox
Signing/verifying with the CIB pdf toolbox merge
Signing/verifying with the CIB pdf toolbox join
General
There are two types of PDF signatures.
A byte range signature is a signature that covers all bytes of almost the entire PDF.
There are two types of that:
- PDF 1.5: An "object digest" is a hash algorithm that will be executed when a subtree of the PDF objects is passed through.
- PDF 1.6 and onwards: The second type is recommended. The entries as in the first type are set, but without passing through a hash algorithm.
To verify the signature, the application has to compare the document at hand with the signed document and check whether changes have been made to objects that are not allowed by the signature entries.
Signing:
The CIB pdf toolbox supports both, the "DocMDP” (= Modification Detection Prevention) object digest signature as well as the "lock" object digest signature. Both are only allowed in a PDF file with a PDF version higher or equal to 1.5. An Adobe Reader version 7.0 or higher is required to read the “DocMDP” signature.
Verifiying the signature:
Currently, the CIB pdf toolbox only verifies if the PDF has been changed again after signing. If this is the case, the PDF is invalid.
It is not yet checked which change has been made and if this change may be permitted. A corresponding extension of the CIB pdf toolbox is planned.
Note: UR3 signatures will be verified and the result is written in the trace, but otherwise the result is ignored.Signing/verifying with the CIB pdf toolbox
PDFs can be signed both with the CIB pdf toolbox merge (-fm) and join (-fj) modules. In case of multiple output PDFs, each PDF is signed individually (by both modules).
Processing with the CIB pdf toolbox will invalidate any eventually contained signatures in the input PDFs. Therefore, they cannot be transferred to the output PDF because the internal structure of the PDF is changed during processing.
When signing the output PDF, all old signatures will be removed from the input PDFs. If the output is not signed, the old signatures can be removed from the input by setting the property “RemovePdfSignatures=1".
If the CIB pdf toolbox merge or join modules are to be used to verify PDF signatures, this has to be done explicitly by setting the property "CheckPdfSignatures=1". Then all signatures of all input PDFs will be verified.
Signing/verifying with the CIB pdf toolbox merge
Using CIB pdf toolbox merge (CIB runshell -fm), only a single input file is possible. If this input file contains a signature, it will only be verified if “CheckPdfSignatures=1” is set.
Using CIB pdf toolbox merge, one or more output files are possible. When signing, each output file will be given its own signature.
Signing/verifying with the CIB pdf toolbox join
Using CIB pdf toolbox join (CIB runshell -fj), one or more input files are possible. If one or more of these input files contain a signature, they will only be verified if “CheckPdfSignatures=1” is set.
Using CIB pdf toolbox join, one or more (SplitPages=1) output files are also possible. When signing, each output file will be given its own signature.
6.2. Properties for signing and verifying the signature
Property description |
Type |
Funcionality |
Kind |
SignPdf |
String |
Property, to activate signing of the output PDF. Possible values: „0“ No signing (default) „1“ PDF will be signed Any signatures contained in the input PDFs are deleted by default. If SignPdf=1, NeedAppearances=0 has to be set. (Then the field "/NeedAppearances" will be set “false” in the PDF document.) Otherwise the generated signature will not be visible in the Adobe signature window. |
Set |
SignPdf.DocMDP |
String |
The signature gets the type „DocMDP“ (author signature). This means that only changes that have been allowed exexplicitly by the author will be made in the PDF afterwards. Other changes invalidate the signature. Requirements: SignPdf=1 and the output file PDF version is higher or equal to 1.5. Possible values: „“ No DocMDP signature (default) „1“ No changes allowed „2“ Allows signing, filling in form fields and creating new pages from page templates: „3“ Allows same processes as in“2”, Otherwise: no DocMDP signature Note: documents with DocMDP signature can only be read by Adobe Reader 7.0 onwards. |
Set |
SignPdf.Lock |
String |
The signature gets the lock type. This means that no changes to form fields are allowed and visible signatures can no longer be added. Requirements: SignPdf=1, SignPdf.DocMDP is not set, and PDF Version of the output is higher or equal to 1.5. Possible values: „0“ No lock for the document (default) „1“ Document will be locked as described above. This corresponds to the "Lock Document After Signing" option in Adobe Professional. The Adobe Reader displays: ”The document is locked by that signature”. |
Set |
CertificateFilename |
String |
Setting the name (with path if necessary) of the certificate file. This must be a PKCS12 certificate file (usual ending ".p12" or ".pfx"). The signature via PEM files is not available yet. There was no suficient testing yet. Multiple PEM files can be specified. They need to be separated by the “;” symbol. All files have to be togheter with only one private key, Additionally, they need to contain the public key and the (optinal) key string of the signer. If a PEM file contains more private keys, the first one that fits to “CerficatePassword” will be used. |
Set |
CertificatePassword |
String |
Setting the password for the certificate file. |
Set |
RemovePdfSignatures |
String |
This property is used to control if existing signatures in the input files will be deleted. Possible values: „0“ Signatures will not be removed. „1“ All signatures will be removed There is a different standard behavior: When signing (SignPdf=1), RemovePdfSignatures=1 is default. Otherwise (and thus also during verification, CheckPdfSignatures=1) RemovePdfSignatures=0 is default. |
Set |
RemovePdfSignaturesKeepAppearance |
String |
This property will only be used whether RemovePdfSignatures=1 or SignPdf=1 is set. Possible values: „0“ When removing the signature, also the visible part of the signatures will be removed. (default) „1“ When removing the signature, the visible part of the signatures will be maintained (e.g. image or text). But the signature will be removed. |
Set |
CheckPdfSignatures |
String |
This property controls whether signatures present in the input files are verified or not. Possible values: „0“ No signature will be verified (default) „1“ All signatures will be verified. |
Set |
TrustedCertificatesDirectory |
String |
Directory containing the trusted certificates (with the public keys) for the CIB pdf toolbox. This directory is mandatory for checking the trustworthiness of the signature certificates in the PDF document with CheckPdfSignature=1.Default: ””. If this property is empty, it is not possible to verify if the signature certificates are trustworthy. But the verification of the signature is still not aborted! The following certificate files with public keys are supported: - CER files („.cer“) in DER and Base64 encoding - CRT files („.crt“) in DER and Base64 encoding - PEM files („.pem“) - P7B files („.p7b“) in DER encoding - P7C files („.p7c“) in DER encoding - SPC files („.spc“) in DER encoding Files with other extensions will be ignored. The certificate files should only contain public keys. |
Set |
OutputFormat |
String |
The verification behavior (i.e. only with CheckPdfSignature=1) of the CIB pdf toolbox is controlled by the assignment of the "OutputFormat" property. A new value "FormatAnalyse" was introduced for this purpose. OutputFormat=”FormatAnalyse”
- OutputFormat not equal to “FormatAnalyse”
|
Set |
SignedDocument.DocumentIsUnmodified |
String |
The change status for each input PDF will be given. A value will be given for each input file in form of a list, separated
by the ; symbol. Possible values: “” Not used by CIB pdf toolbox (default) “1” The document has not been changed after signing. “0” The document has been changed after signing. “not implemented” This functionality has not been implemented. “no signature” The PDF does not contain any signature. |
Get |
SignedDocument.DocumentModificationsAreAllowed |
String |
For each input PDF, any changes made are classified. OutputFormat=“FormatAnalyse“ and CheckPdfSignatures=”1”) For every input data there will be given a value in form of a list, values separated by ; symbol E.g.: „1;0;no signature“. Attention: Possible values: “” Not used by CIB pdf toolbox (default) “1” The document has not been changed after signing. “0” The document has been changed after signing. “not implemented” This functionality has not been implemented. “no signature” The PDF does not contain any signature. |
Get |
SignedDocument.DocumentSignatureDateIsValid |
String |
Only signature date will be verified for each input PDF. (Only relevant for OutputFormat=“FormatAnalyse“ and CheckPdfSignatures=”1”) For every input data there will be given a value in form of a list, values separated by ; symbol E.g.: „1;0;no signature“. Possible values: “” Not used by CIB pdf toolbox (default) “1” The document has not been changed after signing. “0” The document has been changed after signing. “not implemented” This functionality has not been implemented. “no signature” The PDF does not contain any signature. |
Get |
SignedDocument.CertificateChainIsValid |
String |
For each input PDF it will be verified whether the certificate chain
is valid throughout. For every input data there will be given a value in form of a list, values separated by ; symbol E.g.: „1;0;no signature“. Possible values: “” Not used by CIB pdf toolbox (default) “1” The document has not been changed after signing. “0” The document has been changed after signing. “not implemented” This functionality has not been implemented. “no signature” The PDF does not contain any signature. |
Get |
SignedDocument.CertificateIsTrusted |
String |
For each input PDF the trustworthiness of the signatures will be verified. (Only relevant for OutputFormat=“FormatAnalyse“ and CheckPdfSignatures=”1”) For every input data there will be given a value in form of a list, values separated by ; symbol E.g.: „1;0;no signature“. Possible values: “” Not used by CIB pdf toolbox (default) “1” The document has not been changed after signing. “0” The document has been changed after signing. “not implemented” This functionality has not been implemented. “no signature” The PDF does not contain any signature. |
Get |
7. Passwords and encryption with PDFs
In the context of PDF files, the terms "Owner Password" and "User Password" often appear.
The user password has to be entered already to read an encrypted document. With the user password, it is not possible to change or reset the security settings when saving. In addition to the protection against unauthorized opening, additional usage restrictions can be set. These include: Printing not allowed, document modification not allowed, etc.
The owner password allows to change the user password or the permissions. If the owner password is already specified when opening a file protected by the user and owner passwords, the usage restrictions set by the permissions do not apply.
The CIB pdf toolbox requires passwords to be set for various functions. It is also possible to set new passwords for the target file when editing PDF files.
The following questions and answers will hopefully help:
- Can a PDF have an owner password and no user
password?
Yes, this is the case if the user can read the PDF but not edit it (or save/print/whatever is set). - Can a PDF have a user password and no owner
password?
No, in this case the owner password is automatically set internally to the same value as the user password. - Which of the two passwords is required to open
the file in the reader at all?
To open the PDF in a reader, either the owner password or the user password can be entered. - A PDF cannot be encrypted at the same time and have both passwords blank. If both passwords are empty, the PDF will always be saved unencrypted.
7.1. How does the CIB pdf toolbox behave with password protection?
The table below gives an overview of how the CIB pdf toolbox processes password-protected PDF files. Using the example of a procedure for joining 2 PDF files (CIB pdf join), all possible variants are explained.
Main file = First file specified at InputFilename.
|
Attached file does not have any password. |
Attached file has an owner password. |
Attached file has owner and user password. |
Main file has no password. |
Output file has no password. |
Output file has the password in the attached file. |
Output file has the password in the attached file. |
Main file has an owner password. |
Output file has the owner password of the main file. |
Output file has owner password of the main file. |
Output file has owner password of the main file. |
Main file has owner and user password. |
Output file has owner and user password of the main file. |
Output file has owner and user password of the main file. |
Output file has owner and user password of the main file. |
To sum up, it can be said that:
If several files are joined togheter and several of them are password protected, the first password found will always be used for the output file.
The fact whether the output file is encrypted and which encryption algorithm is used for this will be decided by the same logic as described in the table above for the password.⚠️ If the output document should get a new, individual password protection or should be encrypted differently, the properties „OutputOwnerPassword“ and/or „OutputUserPassword“ have to be set to CIB pdf/join.
7.2. Properties for password protection and encryption
Property description |
Type |
Functionality |
Kind |
AllowPdfPermissions (from CIB pdf toolbox 1.8.3 onwards) |
String |
The property can be used to decide if the editing rights set in the PDF via the owner password are taken into account during processing.
Attention: Any user password assigned in the PDF must be set, otherwise no processing will take place. The generated output PDF is not encrypted. 1 Rights will be ignored 0 Rights will be taken into account (default)
This property must be set to the value "1" when converting a PDF/A file protected with an owner password. Otherwise it will result in an error. |
Set |
EncryptDocumentPassword (from CIB pdf toolbox 1.18.0 onwards) |
String |
This property can be used to pass the password for a password-protected document without specifying whether it is an EncryptUserPassword or EncryptOwnerPassword. The syntax is identical to that of these two properties. If the EncryptDocumentPassword is set, the CIB pdf toolbox will detect which password is used (User or Owner). For the feedback of this information the
PDFPERMISSION (= SECURITYINFO) metadata has been extended by the flag
IsOwnerAccess: Attention: |
Set |
EncryptOwnerPassword |
String |
Owner password of the input file(s) or BackgroundFilename. The passwords have to be listed in exactly the same order as the corresponding files within the InputFilename /BackgroundFilename (separated by ; symbol). The password itself cannot contain the ; symbol. |
Set |
EncryptUserPassword |
String |
User password of the input file(s) or BackgroundFilename. The passwords have to be listed in exactly the same order as the corresponding files within the InputFilename /BackgroundFilename (separated by ; symbol). The password itself cannot contain ; symbol. |
Set |
OutputOwnerPassword |
String |
Assigns new owner password for the output file. The password itself cannot contain ; symbol. |
Set |
OutputUserPassword |
String |
Assigns a new user password for the output file. The password itself cannot contain ; symbol. |
Set |
PdfUserPasswordPresent |
String |
Possible values: „“ or „0“ = no user password available “1” = user password available |
Get |
PdfOwnerPasswordPresent |
String |
Possible values: „“ or „0“ = no owner password available “1” = owner password available |
Get |
PdfVersion |
String |
Setting the PDF version to be generated. Valid values: “1.3” Acrobat family 4 “1.4” Acrobat family 5 (default) “1.5” Acrobat family 6 “1.6” Acrobat family 7 „1.7“ Acrobat family 8 From CIB
pdf toolbox Version 1.4.109 onwards: Hint: |
Get/ |
EncryptMetadata (from CIB pdf toolbox 1.4.109 onwards) |
String |
By setting this property, the user can decide if the metadata will be encrypted in the PDF. Metadata is general information about the PDF, such as author, creation date, and so on. The format and content of the metadata is not fixed and depends on the tool that created the PDF. Possible values: Hint: |
Get/ |
The settings of the following Encryptxxx properties (permissions) are generally transferred to the output document with the password from the input. See chapter "How does the CIB pdf toolbox behave with password protection? For unencrypted input, all switches in the output are set TRUE. If a new password (OutputOwnerPassword, OutputUserPassword) is assigned to the output document, the permissions can be reassigned by setting the following Encryptxxx properties. |
|||
EncryptEnableAssembling |
String |
Approve document assembly for the output file. Possible values: |
Set |
EncryptEnableClipboard |
String |
Approve content copying for the output file. Possible values: |
Set |
EncryptEnableExtract |
String |
Screen reader programs (e.g. for the visually impaired) can access the content. The user is not allowed to copy text and graphics from the PDF file if this value is set. Possible values: „0“ No permission (default) „1“ Action permitted |
Set |
EncryptEnableForms |
String |
Approve completion of form fields for the output file. Possible values: |
Set |
EncryptEnableModifying |
String |
The user may modify the PDF file (add text etc.) if this value is set. Possible values: „0“ No permission (default) „1“ Action permitted |
Set |
EncryptEnableNotes |
String |
The user may add text notes and AcroForm fields to the PDF file and modify existing ones if this value is set. Possible values: „0“ No permission (default) „1“ Action permitted |
Set |
EncryptEnablePrinting |
String |
Approve printing for the output file. Possible values: |
Set |
PdfEncryptionLevel |
String |
Returns the encryption depth, which is greater or equal to 40 and always a multiple of 8. |
Get |
PdfEncryptionAlgorithm |
String |
Returns the value of the encryption algorithm. „0“ = undocumented algorithm „1“ = PDF encryption 40 bit (RC4-40) „2“ = PDF encryption, 40 bit oder higher (RC4-128) „3“ = undocumented algorithm From CIB pdf toolbox 1.4.107 onwards: „4“ = AES-128 From CIB pdf toolbox 1.4.109 onwards: „5“ = AES-256
|
Get |
PdfPermissionAssemble |
String |
Possible values are: „“ = swap pages, create bookmarks and thumbnails allowed „NotAllowed” = swap pages, create bookmarks and thumbnails not allowed |
Get |
PdfPermissionContentAccess |
String |
Possible values are: „“ = cutting text and graphics is allowed „NotAllowed” = cutting text and graphics is not allowed |
Get |
PdfPermissionCopy |
String |
Possible values are: „“ = copying text and graphics is allowed „NotAllowed” = copying text and graphics is not allowed |
Get |
PdfPermissionFillFormFields |
String |
Possible values are: „“ = filling in form fields, including signature fields, is allowed „NotAllowed“ = filling in form fields, including signature fields, is not allowed |
Get |
PdfPermissionModify (from CIB pdf toolbox 1.4.78 onwards) |
String |
Possible values are: „“ = modification is allowed (bit 3 is set or document is not encrypted) „NotAllowed“ = modification is not allowed (bit 3 is not set) |
Get |
PdfPermissionModifyAnnotations (from CIB pdf toolbox 1.4.78 onwards) |
String |
add or modify text annotations and (if modify permission is true) form fields Possible values are: „“ = Modification of annotations is allowed (bit 5 is set or document is not encrypted) „NotAllowed“ = Modification
of annotations is not allowed |
Get |
PdfPermissionPrint |
String |
Possible values are: „“ = Printing allowed „NotAllowed“ = Printing not allowed „Low Resolution“ = Printing only in low resolution allowed |
Get |
PdfPermissions |
String |
Bit field as decimal number, permitted access types without master password |
Get |
8. Retrieving PDF information
(from CIB pdf toolbox Version 1.6.116f onwards)
With a CIB pdf toolbox join global document properties can be read from the PDF. For this purpose the property OutputFormat must be set to the value "FormatInfo". Only one PDF file may be specified as input document. The specification of an output file is ignored. Apart from reading the document properties, no further processing takes place.
The values from the PDF are transferred to properties. Specifically, the following properties are involved:
PageCount: |
Number of pages in the document |
PageCount: |
Number of pages in the document |
DocInfo.Author: |
Author |
DocInfo.Title: |
Title |
DocInfo.Subject: |
Subject |
DocInfo.Keywords: |
Keywords |
DocInfo.CreationDate: |
Creation date |
DocInfo.ModDate: |
Modification date |
PdfPermissionAssembly: |
Swap pages, generate bookmarks and thumbnails is (not) allowed |
PdfPermissionContentAccess: |
Cutting text and graphics (not) allowed |
PdfPermissionCopy: |
Copying text and graphics (not) allowed |
PdfPermissionFillFormFields: |
Filling in form fields, including signature fields, is not allowed |
PdfPermissionPrint: |
Printing (not) allowed
|
From CIB pdf toolbox Version 1.20 onwards, additional information about fonts and images can be included in a PDF document.
For this purpose the property FilterInfo must be set with the options „FilterInfo=FontsInfo;ImagesInfo“.This will fill the output properties FontsInfo and ImagesInfo.
ImagesInfo has the following JSON syntax:
[
\{”ID”:<NumID>, “Height”:<NumHeight>, “Width”:<NumWidth>, “IsMask”:<true/false>, “CompressionMethod”:”<Method>”, “CompressedSize”:<Size>}
,...]
Example:
[
\{”ID”:15, “Height”:32, “Width”:32, “IsMask”:false, “CompressionMethod”:”DCTDecode”, “CompressedSize”:256}
,...]
FontsInfo has the following JSON syntax:
[ \{”ID”:<NumID>, “Name”:”<FontName>”, “Type”:”<FontType>”,”Embedded”:<true/false>,”CompressedSize”:<NumericSize>}} ...]
Example:
[ \{”ID”:10, “Name”:”Courier”, “Type”:”Type1”,”Embedded”:true,”CompressedSize”:1024}}, ...]
9. Adding and removing bookmarks
(from CIB pdf toolbox 1.6.116 onwards)
Using CIB pdf toolbox Join, bookmarks (or outlines) in PDF documents can be added or removed. This can be done with the following properties:
Property description |
Type |
Functionality |
Kind |
OutlinesDeleteExisting |
String |
Remove all outlines or bookmarks from input documents. Possible values: „0“: The existing outlines will not be removed. (default) „1“: All existing outlines will be removed. |
Set |
OutlinesAdd |
String |
Adding new outlines and bookmarks to the output PDF document. If bookmarks already exist and should be kept (i.e. OutlinesDeleteExisting=0), the new bookmarks are added to the existing ones. Possible values: „ “: No outlines will be added. (default) A non-empty string: The outlines specified in this property are
inserted into the output PDF. If the syntax is incorrect:
error code 349 (CIBPDF_ERROR_OUTLINES_ADD_WRONG_FORMAT) Syntax: <outlinelist> ::= <outline> | <outline> “;” <outlinelist> <outline> ::= <outline-with-descendants> | <outline-without-descendants> <outline-with-descendants> ::= “{” <page> “;{” <destination> “};” <outlinetext> “;{” <outlinedescendants> “}}” <outline-without-descendants> ::= “{” <page> “;{” <destination> “};” <outlinetext> “}” | “{” <page> “;{” <destination> “};” <outlinetext> “;{}}” <page> ::= <Integer> <outlinetext> ::= <text> <outlinedescendants> ::= <outlinelist> <destination> ::= <XYZ> | <Fit> | <FitH> | <FitV> | <FitR> | <FitB> | <FitBH> | <FitBV> <XYZ> ::= „XYZ“ „;“ <Integer> „;“ <Integer> „;“ <Integer> <Fit> ::= “Fit” <FitH> ::= “FitH” “;” <Integer> <FitV> ::= „FitV“ „;“ <Integer> <FitR> ::= „FitR“ „;“ <Integer> „;“ <Integer> „;“ <Integer> „;“ <Integer> <FitB> ::= „FitB“ <FitBH> ::= „FitBH“ „;“ <Integer> <FitBV> ::= „FitBV“ „;“ <Integer> See next sections for details and examples. |
Set |
(from CIB pdf toolbox 1.10.0 onwards) |
|
Property returns a string with identical structure. |
Get |
Syntax of OutlinesAdd
One or more bookmarks (outlines) can be inserted in the OutlinesAdd string property.
Syntax:
Outline1;Outline2;...;Outline3
Outlinen: {page number;{view};text;{subbookmarks}}
Page number
A positive integer that indicates to which page the bookmark points.
E.g. “7”: The bookmark refers to page 7 of
the output document.
Especially when using Join to combine several input PDFs to one output document,
it is important that the page number refers to the joined output document.
View
A string that determines which part of the page should be displayed with which zoom factor. There are eight different types of this "view".
These are described in the following table. Number1, Number2, Number3 and Number4 are all non-negative integer numbers. “Window" refers to the display window of the PDF viewer, e.g. Adobe Reader.
Name of the “view” |
Syntax of the “view” |
Description of the “view” |
XYZ |
XYZ;number1;
number2; |
The specified page is displayed so that the x-y coordinate (number1;number2) of the page is at the top left of the window. Number3 is the zoom factor for the page (e.g. Number3=1 is a zoom of 100%, Number3=2 is a zoom of 200%, etc.). Especially number3=0 means that the current zoom factor remains unchanged. |
Fit |
Fit |
The specified page will be enlarged so much that the page fills the window exactly. If this is not possible exactly, the page is enlarged so that the page is always completely visible in the window. One dimension of the page then fills the window exactly. The other dimension of the page is then smaller than the window and is centred within the window. |
FitH |
FitH;number1 |
The specified page is displayed so that the y-coordinate number1 of the page is displayed exactly at the top of the window. At the same time, the page is enlarged so that the width of the page fills the window exactly. |
FitV |
FitV; number1 |
The specified page is displayed so that the x-coordinate number1 of the page is displayed exactly on the left edge of the window. At the same time, the page is enlarged so that the height of the page fills the window exactly. |
FitR |
FitR; number1;
number2; |
The values (number1;number2;number3;number4) are the coordinates of a rectangle within the page (x-value-left;y-value-bottom;x-value-right;y-value-top). The page is displayed and enlarged so that this rectangle fills the window exactly. If this is not possible exactly, the page is enlarged so that the rectangle is always completely visible in the window. One dimension of the rectangle then fills the window exactly while the other dimension of the rectangle is smaller than the window and is centered within the window. |
FitB |
FitB |
The specified page is enlarged so that the page's bounding box exactly fills the window. If this is not possible, the page is enlarged so that the page's bounding box is always completely visible in the window. One dimension of the bounding box then fills the window exactly while the other dimension of the bounding box rectangle is smaller than the window and is centered within the window. |
FitBH |
FitBH;number1 |
The specified page is displayed so that the y-coordinate number1 of the page is displayed exactly at the top of the window. At the same time, the page is enlarged so that the width of the page's bounding box fills the window exactly. |
FitBV |
FitBV;number1 |
The specified page is displayed so that the x-coordinate number1 of the page is displayed exactly at the left edge of the window. At the same time, the page is enlarged so that the height of the page's bounding box fills the window exactly. |
Examples:
a.)
{XYZ;100;200;3}
The page is displayed so that the page coordinate (x;y) = (100;200) is at the
top left edge of the window. Zoom factor for the page is 300%.
b.)
{XYZ;200;300;0}
The page is displayed so that the page coordinate (200;300) is at the top left
of the window. Zoom factor for the page remains unchanged.
c.) {FitH;200}
The specified page is displayed so that the y-coordinate 200 of the page is exactly
at the top of the window. At the same time, the page is enlarged so that the
width of the page fills the window exactly.
d.) {FitV;100}
The specified page is displayed so that the x-coordinate 100 of the page is
exactly at the left edge of the window. At the same time, the page is enlarged
so that the page fills the height of the window exactly.
e.) {FitR;20;40;100;400}
The rectangle with the x-coordinates 20 and 100, and the y-coordinates 40 and
400 should fill the window. If this is not possible exactly, the page is
enlarged so that the rectangle is always completely visible in the display
window. One dimension of the rectangle then fills the window exactly while the
other dimension of the rectangle is smaller than the window and is centered
within the window.
Text
A string that specifies the name under which the bookmark is displayed in the bookmarks window of the viewer (e.g. from Adobe).
Important:
If in the name appear one of these characters ;{}\ , this special character has to be marked with a backslash "\" symbol.
Example:
The bookmark name in
the PDF viewer: “{Berlin;Hamburg}”
requires the following “text” in “OutlinesAdd”: “\{Berlin\;Hamburg\}”
The bookmark name in the PDF viewer: “Q\R; V\R; L\Z”
requires the following “text”: “Q\\R\; V\\R\; L\\Z”.
The entry for "subbookmarks" is optional. If it exists, it specifies one or more bookmarks that are sub-bookmarks to the specified bookmark..
A.) There are two possibilities of syntax indicating that a bookmark has no subbookmark.
a.) By removing the whole entry and the semicolon before it:
{Seitennummer;{Ansicht};Text}
b.) Or by leaving the curly brackets empty:
{page number;{view};text;{}}
E.g.: {1;{Fit};chapter 1} und {1;{Fit};chapter 1;{}} are identical bookmarks without subbookmarks.
B.) If there are subbookmarks, they consist of one or more bookmarks. These are structured exactly like the other bookmarks. This way you can specify a whole chain of main, sub and sub-sub bookmarks.
Here are several examples for this "bookmark chaining". For convenience of the user, "{Fit}" is always used as "view". Of course, all other "views" described above can also be used in each individual bookmark. The colors are only for better comprehensibility: Different colors mean different individual bookmarks.
a.) {1;{Fit};bookmark 1}
is an individual bookmark called "bookmark 1", which refers to page 1. This has no subbookmarks. You can also write this alternatively
{1;{Fit};bookmark 1;{}}
b) {1;{Fit};1. mail chapter 1};{4;{Fit};2. main chapter 2};{8;{Fit};3. main chapter 3}
are three (main) chapters. None of them has subbookmarks. The bookmark with the name “1. main chapter 1” (violet font) refers to page 1. The bookmark with the name “2. main chapter 2” (blue font) refers to page 4. And the bookmark named “3. main chapter 3” (green font) refers to page 8.
c) {1;{Fit};1. mail chapter 1;{{4;{Fit};1.1. main chapter 1};{7;{Fit};1.2. main chapter 2}}}
specifies a bookmark named "1. main chapter 1" (black font), which refers to page 1. This has 2 subbookmarks: One called "1.1. sub chapter 1” (violet font); which refers to page 4. And one with the name “1.2. sub chapter 2” (blue font) which refers to page .
d) {1;{Fit};1. main chapter 1;{{2;{Fit};1.1. sub chapter 1;{{3;{Fit};1.1.1. sub chapter 1;{{5;{Fit};1.1.1.1. sub sub chapter 1} }}}}}}
indicates a bookmark with the name "1. main chapter 1" (black font) that refers to page 1. This has a subbookmark named "1.1. subchapter 1” (violet font), which refers to page 2. This has a subbookmark with the name "1.1.1. sub subchapter 1” (blue font), which refers to page 3. This one has a subbookmark too called “1.1.1.1. sub sub subchapter 1” (green font), which refers to page 5.
The structure of these bookmarks would look as follows in the viewer (colors are only for clarification. The bookmarks in the PDF viewer would not have these colors):
1. main chapter 1
1.1. sub chapter 1
1.1.1. sub sub chapter 1
1.1.1.1. sub sub sub chapter 1
e) {3;{Fit};1. main chapter 1;{{6;{Fit};1.1. sub chapter 1;{{9;{Fit};1.1.1. sub sub chapter 1};{11;{Fit};1.1.2. sub sub chapter 2;{{13;{Fit};1.1.2.1. sub sub sub chapter 1}}};{16;{Fit};1.1.3 sub sub chapter 3}}};{21;{Fit};1.2. sub chapter 2}}};{25;{Fit};2. main chapter 2;{}}
Die Struktur dieser Lesezeichen würde wie folgt aussehen:
The structure of these bookmarks would look as follows:
1. main chapter 1
1.1. sub chapter 1
1.1.1. sub sub chapter 1
1.1.2. sub sub chapter 2
1.1.2.1. sub sub sub chapter 1
1.1.3 sub sub chapter 3
1.2. sub chapter 2
2. main chapter 2
f) {6;{Fit};1. main chapter 1;{{9;{Fit};1.1. sub chapter 1;{{12;{Fit};1.1.1. sub sub chapter 1;{{15;{Fit};1.1.1.1. sub sub sub chapter 1} }};{17;{Fit};1.1.2. sub sub chapter 2;{{21;{Fit};1.1.2.1. sub sub sub chapter 1};{23;{Fit};1.1.2.2. sub sub sub chapter 2}}} }};{25;{Fit};1.2. sub chapter 2}}};{28;{Fit};2. main chapter 2}
The structure of these bookmarks would look as follows:
1. main chapter 1
1.1. sub chapter 1
1.1.1. sub sub chapter 1
1.1.1.1. sub sub sub chapter 1
1.1.2. sub sub chapter 2
1.1.2.1. sub sub sub chapter 1
1.1.2.2. sub sub sub chapter 2
1.2. sub chapter 2
2. main chapter 2
10. Extract barcode information from PDF
(from CIB pdf toolbox Version 1.8.0 onwards)
With CIB pdf toolbox Join, barcodes can be read from barcode images in PDF documents. As output format for the barcode information XML or CSV is possible.
The CIB pdf
toolbox generates a metafile from PDF, which is further processed by the CIB
ocr module. Therefore, this functionality requires the module CIB ocr with a
corresponding license.
(from CIB pdf toolbox Version 1.13.3 onwards):
Now it is possible to set all CIB ocr StringProperties with prefix "CibOcr" in their name to the CIB pdf toolbox. These properties will be transferred to the CIB module in case of an OCR or barcode reading request.
Example:
CIB ocr has the property "DatamatrixScanGap=100". The property "CibOcrDatamatrixScanGap=100" is set to the CIB pdf toolbox, which is then transferred as DatamatrixScanGap with value "100" when the CIB pdf toolbox is called.
Property description |
Type |
Functionality |
Kind |
BarcodeRange |
String |
This property contains a list of barcode types separated by semicolons. All images in the PDF are checked to see if they are barcodes of the specified types. The search can also be restricted to areas of the PDF. Syntax: <barcoderangelist> ::= <barcodetypes> | <barcoderanges> <barcoderanges> ::= <onebarcoderange> | <onebarcoderange> “;” <barcoderanges> <onebarcoderange> ::= “{” <pagenumber> “}” | “{” <pagenumber> “;” <barcodetypes> “}” | “{” <pagenumber> “;” <barcodetype> “;” <rangeleft> “;” <rangebottom> “;” <rangeright> “;” <rangetop> “}” <pagenumber> ::= <Integer> <barcodetypes> ::= <onebarcodetype> | <onebarcodetype> “,” <barcodetypes> <onebarcodetype> ::= “DataMatrix” | “Code128” | “CodeITF” | “Code39” | “Code39Extended” | “QR” <rangeleft> ::= <Integer> <rangebottom> ::= <Integer> <rangeright> ::= <Integer> <rangetop> ::= <Integer> <rangeleft>, <rangebottom>,
<rangeright>, <rangetop> are positive integers in mm, origin (0;0
is the lower left corner of the PDF page. „ “: (Property is empty) All images of the PDF are checked for barcode information and this is done with the two barcode types "QR" and "DataMatrix". (default) Incorrect assigning of the property results in returning error code 100. See below for examples. |
Set |
BarcodeInfo |
String |
The retrieved barcode information is returned to this property. If an output file (OutputFilename) and a memory area (MemoryOutputCallback) are specified, the output is sent to this file and also to memory. Hint: If no barcode is found in the specified area, the property/output file remains empty. The format of the output depends on the contents of the OutputFormat property. Possible are OutputFormat= FormatBarcodeXml /FormatBarcodeCsv. The coordinate origin (0;0) is the lower left corner of the PDF page. OutputFormat=FormatBarcodeXml : <barcodeimagexml> ::= <empty value> | „<?xml version=”1.0” encoding=”UTF-8” standalone=”yes”?><barcodeimages>“ <barcodeimagelist> „</barcodeimages>“ <barcodeimagelist> ::= <onebarcodeimage> | <onebarcodeimage> <barcodeimagelist> <onebarcodeimage> ::= „<barcodeimage><pagenumber>“ <pagenumber> „</pagenumber><left>“ <imageleft> „</left><bottom>“ <imagebottom> „</bottom><right>“ <imageright> „</right><top>“ <imagetop> „</top><barcodeinfos>“ <barcodeinfolist> „</barcodeinfos></barcodeimage>“ <pagenumber> ::= <Integer> <imageleft> ::= <Integer> <imagebottom> ::= <Integer> <imageright> ::= <Integer> <imagetop> ::= <Integer> <barcodeinfolist> ::= <onebarcodeinfo> | <onebarcodeinfo> <barcodeinfolist> <onebarcodeinfo> ::= „<barcodeinfo type=”“ <barcodetype> „”“ <barcodecontent> „</barcodeinfo>“ <barcodetype> ::= „DataMatrix“ | „Code128“ | „CodeITF“ | „Code39“ | „Code39Extended“ | „QR“ <barcodecontent> ::= <Text>
OutputFormat=FormatBarcodeCsv: <barcodeimagecsv> ::= <empty value> | <barcodeimagelistcsv> <barcodeimagelistcsv> ::= <onebarcodeimagerow> | <onebarcodeimagerow> <barcodeimagelistcsv> <onebarcodeimagerow> ::= <pagenumber> „;“ <imageleft> „;“ <imagebottom> „;“ <imageright> „;“ <imagetop> „;“ <barcodeinfolistcsv> <CR> <LF> <pagenumber> ::= <Integer> <imageleft> ::= <Integer> <imagebottom> ::= <Integer> <imageright> ::= <Integer> <imagetop> ::= <Integer> <barcodeinfolistcsv> ::= <onebarcodeinfocsv> | <onebarcodeinfocsv> „;“ <barcodeinfolistcsv> <onebarcodeinfocsv> ::= „;“ | <barcodetype> „;“ <barcodecontent> <barcodetype> ::= „DataMatrix“ | „Code128“ | „CodeITF“ | „Code39“ | „Code39Extended“ | „QR“ <barcodecontent> ::= „““ <Text> „““ Hints regarding CSV:
See below for examples |
Get |
OCRDebug |
String |
This property is only relevant for technical test purposes. It controls the output of images from the PDF. Possible values: „1“ The intermediate steps of barcode extraction using OCR get individual output files. „0“ No output for intermediate steps. (default) For every single image in the PDF document, which was transferred to the CIB Ocr Dll, the outputs are several files:
The files are written to the same directory as the output file. The names of these files have the following form: “output-file”__Page_”page-number”_Image_“image-number“_“file-extension“ The following applies to the "file extension“:
Example: |
Set |
BarcodeRecognitionMode |
String |
This property controls which method of barcode recognition is to use. "RecognizeImages": The original method is used. CIB pdf toolbox provides separate image objects to CIB ocr for recognition. (default) "RecognizePages": CIB pdf toolbox provides complete page images to CIB ocr for recognition. Note: Using RecognizePages could be slower than the original method since complete image for page should be recognized. |
|
10.1. Examples for barcode range
- “Code128”
All images are checked for barcode information, using the barcode type “Code128”. - “QR;CodeITF;Code39;DataMatrix”
All images are checked for barcode information, using the barcode type “QR”, “CodeITF”, “Code39” und “DataMatrix”. - “{1}”
All images in the first page of the document are checked for barcode information, using the barcode types DataMatrix and QR. - “{3;Code128}”
All images in the 3rd page of the document are checked for barcode information, using the barcode type Code128. - “{8;Code39,QR,DataMatrix}”
All images in page 8 of the document are checked for barcode information, using the barcode types Code39, QR and DataMatrix. - “{13;CodeITF,QR};{22;Code39Extended,DataMatrix}”
All images on pages 13 and 22 are checked for barcode information. For the images on page 13, this is done with the barcode types CodeITF and QR. For the images on page 22, using the barcode types Code39 and DataMatrix. - “{2;DataMatrix,Code39;20;30;40;50}”
All images are checked which are on the 2nd page and within the rectangular area (Left;Bottom;Right;Top)=(20;30;40;50). (This rectangular area starts horizontally 20 mm from the left page margin and ends 40 mm from the left page margin. It starts vertically 30 mm from the bottom of the page and ends 50 mm from the bottom of the page). The barcode types used are DataMatrix and Code39. - “{6;Code39Extended;1;2;3;4};{24;CodeITF,Code39,DataMatrix;100;0;200;300}”
It will be checked: All images on page 6 that are within the rectangular area (1;2;3;4) (between 1 mm and 3 mm from the left margin and between 2 mm and 4 mm from the bottom margin). The barcode type used is Code39Extended. The same applies to all images on page 24 that are in the rectangular area (100;0;200;30). The barcode types used for this are CodeITF, Code39 and DataMatrix. - “{15;DataMatrix,CodeITF;2;45;20;100};{11;QR};{16;Code39;5;10;15;20}”
It will be checked: All images on page 15 that are in the rectangular area (2;45;20;100). The barcode types used are DataMatrix and CodeITF. The same applies to all images on page 11. The barcode type used is QR. Also all images of page 16 which are in the rectangular area (5;10;15;20). The barcode type used for this is Code39.
General:
If different ranges in the enumeration match a certain image, the first matching range within the BarcodeRange enumeration is used and the barcode types from this range are selected.
10.2. Examples for BarcodeInfo, OutputFormat=FormatBarcodeXml
BarcodeInfo
“<?xml version=”1.0” encoding=”UTF-8” standalone=”yes”?>
<barcodeimages>
<barcodeimage>
<pagenumber>23</pagenumber>
<left>30</left>
<bottom>100</bottom>
<right>200</right>
<top>600</top>
<barcodeinfos>
<barcodeinfo type=”Code39”>Der Inhalt des Barcodeimages 1.</barcodeinfo>
<barcodeinfo type=”Code39Extended”>Der Inhalt des Barcodeimages 1.</barcodeinfo>
</barcodeinfos>
</barcodeimage>
<barcodeimage>
<pagenumber>35</pagenumber>
<left>0</left>
<bottom>10</bottom>
<right>400</right>
<top>140</top>
<barcodeinfos>
<barcodeinfo type=”QR”>Der Inhalt des Barcodeimages 2.</barcodeinfo>
<barcodeinfo type=”DataMatrix”>Der Inhalt des Barcodeimages 2.</barcodeinfo>
</barcodeinfos>
</barcodeimage>
</barcodeimages>”
means:
barcode images were detected that were within the ranges specified by BarcodeRange. The first barcode image was on page 23 and covers the following rectangular area (the left edge is 30 mm from the left edge of the PDF page. The bottom margin is 100 mm from the bottom edge of the PDF page. The right margin is 200 mm from the left margin of the PDF page. The top margin is 600 mm from the bottom edge of the PDF page). Using the barcode types Code39 and Code39Extended barcode information was successfully extracted. In both cases this is "The content of the barcode image 1.".
The second barcode image was on page 35. The rectangular area is here (left, bottom, right, top) = (0;10;400;140). The barcode types QR and DataMatrix were successfully used here. The extracted barcode information for this barcode image is "The content of the barcode image 2." for both barcode types.10.3. Examples for BarcodeInfo, OutputFormat=FormatBarcodeCsv
BarcodeInfo =2;10;30;200;400;QR;”This is barcode image 1.”;;\r\n3;50;60;150;160;Code39;”This is barcode image 2.”;Code39Extended;”This is barcode image 2.”\r\n
1.) means:
two barcode images were detected that were within the ranges specified by BarcodeRange. The first barcode image was on page 2 and covers the following rectangular area (The left edge is 10 mm from the left edge of the Pdf page. The bottom margin is 30 mm from the bottom edge of the pdf page. The right margin is 200 mm from the left margin of the pdf page. The top margin is 400 mm from the bottom edge of the pdf page) The barcode type QR has been used successfully. The result was 'This is barcode image 1.'.
The second barcode image was on page 3, the rectangular area is here (left, bottom, right, top) = (50;60;150;160). Using the barcode types Code39 and Code39Extended the barcode information was successfully extracted. In both cases this is 'This is barcode image 2.'.
In the first barcode image, ';;' was inserted at the end because the 2nd barcode image contained 2 barcode information and this CSV line therefore had 2 additional columns.BarcodeInfo=15;10;30;200;400;CodeITF;”””This”” is “” “” the barcode image;””Hello”””;;\r\n
A barcode image was detected that was within the range specified by BarcodeRange. It was on page 15. The rectangular area for this image is (left, bottom, right, top) = (10;30;200;400). The barcode type CodeITF was successfully applied. The result was '"This" is " " the barcode image; "Hello"'. (The double quotation marks in the barcode content must be replaced by single quotation marks.)
11. Supported graphic formats
Which graphic formats are supported by the CIB pdf toolbox depends on the processing mode of the affected PDFs. In the following chapters the different possibilities are described.
CIB pdf join/ CIB pdf mergeCIB pdf print / processing for the CIB viewer
Graphic Overlay
Generating graphic files
Insert text from graphics into PDFs using CIB ocr
CIB pdf join/ CIB pdf merge
All graphic formats are possible here, since the image objects are not processed, but only copied.
CIB pdf print / processing for the CIB viewer
Supported formats are:
- RAW (Image data are available in a format described by the PDF Spec.)
- JPG
- TIFF
- JBIG2 (from CIB pdf toolbox Version 1.4.100 onwards)
- JPEG2000 (from CIB pdf toolbox Version 1.4.101 onwards)
Hint:
The image objects in these PDFs do not contain a complete JPG or TIFF, but only the image data itself (i.e. no color palette and metadata).
For processing JBIG2 a special library Jbig2dec.dll is required. The library is also available for Unix platforms.
Graphic Overlay
Supported graphic formats are BMP, JPG, GIF und PNG.
Please find detailed information about this in the chapter „Overlay functionality/graphics“.Generating graphic files
(from CIB pdf toolbox 1.4.102 onwards)
With the CIB pdf join module of the CIB pdf toolbox, it is possible to create graphic files in addition to PDF output.
The output format is set by the OutputFormat property.
The following graphic formats are supported:- FormatTiff
- FormatPng,
- FormatJpeg
One graphic file per page in the PDF is generated, whereby the file names are made unique by automatic numbering. Only with TIFF is multi-page output to a TIFF file possible.
From CIB pdf toolbox version 1.5.113 onwards, these graphic formats are also available on Unix platforms.
(from CIB pdf toolbox Version 1.8.5a onwards:- FormatBmp
- FormatBmpLz4 (BMP, but files corresponding to the lz4 Standard are compressed).
(from CIB pdf toolbox Version 1.9.0 onwards):
- FormatJpegXR
- FormatWebP (if RenderingEngine=CIBRenderer)
The resolution, compression, etc. can be specified in more detail for the individual graphic formats via corresponding property assignments.
Further information on this topic can be found in the chapter „CIB pdf/join / split“.
(from CIB pdf toolbox 1.4.113 onwards)
Property OutputFormat = FormatExtractImages
If this output format is specified, all Image-XObjects contained in the input PDFs are exported. The output is in TIFF format or (for certain Pdf image objects) in JPEG format under the file name specified in OutputFilename.
For TIFF images, it is possible to export into a single TIFF file or into a separate TIFF file for each image. For details on this and on exporting JPEG images, see description of the Property OutputFormat = FormatExtractImages.PDF Layer Support
(from CIB pdf toolbox 1.40.0 onwards)
Processing and rendering of optional content groups is implemented into CIB pdf toolbox.
Optional content is handled within marked content streams, and also for XObjects and Annotations, having OC entry. It is able to communicate with doxiview, using input and output properties and JSON based arguments.
Property description |
Functionality |
Kind |
PdfLayers |
Syntax: PdfLayers={"RequestedStates":[{"LayerId":<Id1>,"State":"On"/"Off"},..., {"LayerId":<IdN>,"State":"On"/"Off"}]} where: Id1...IdN
are numeric IDs of the optional content layers, and the layer state is
"Off" (invisible), or "On" (visible) After knowing this info, the outer application can request arbitrary states (visible/not visible) for any OC layers.
|
Set |
PdfLayersInfo |
The output property outputs info about the existing optional content layers and their states. Syntax: PdfLayersInfo={"Tree":[<LayerDescription>], "PageLayers":[<PageLayersDescription>]} where: Tree is an array, describing hierarchical structure of the existing layers in PDF. Tree contains the items: <LayerDescription> which is a description of each layer: {"Name":"<LayerName>", "LayerId":<Id>,"Locked":true/false, "State":"On"/"Off", "RBGroups":[<RBId1>,...<RBIdN>],"Kids":[ <LayerDescription> ]} where: "LayerId": <Id> is unique number, (layer identifier that should be used for input property PdfLayers). Locked: true/false shows if an user can switch the current state of the layer. Kids: array, describing all kids of the layer.
PageLayers is an array of pages and their layers: PageLayersDescription = {"PageIndex":<PageId>, LayerIds:[<LayerId>]} <PageId> is an index of a page, starting from 0 LayerIds is an array of <LayerId> (numeric id) that could be mapped to appropriate LayerIds from Tree object. Note:
|
Get |
Insert text from graphics into PDFs using CIB ocr
(from CIB pdf toolbox 1.6.116 onwards)
For images in PDF documents that contain text, the CIB ocr module can be used to extract this text from image via the CIB pdf toolbox and insert it into the PDF document as text. The main use case for this feature are scanned PDF documents where the text is only available as an image and therefore there is no possibility to search for text or copy it.
This functionality is available for both PDF Join and PDF Merge. It requires the CIB ocr module with a corresponding license.
The result is a PDF document similar to the input document(s), but containing (in)visible text, the text extracted from the images. This text can be searched for and copied from the PDF document.
From CIB pdf toolbox 1.9.0 onwards, it is possible to import such (in)visible text from external sources. This means that the text is no longer extracted from the images of the PDF document, but is instead transferred to the toolbox by the property "HocrInputData". This property consists of one or more memory blocks containing the Hocr data. For the exact format please see the property below.
In addition, from CIB pdf toolbox 1.9.0 onwards, all generated or imported Hocr data can be output as multi-Hocr files. The HocrOutputFilename property specifies the file in which the Hocr data should be saved.
From CIB pdf toolbox 1.10.0 onwards it is also possible to import a multi-page HOCR XML file. For this purpose, the property HocrInputData is assigned the path of this file. All information (like page numbers, fonts, ...) are contained in this HOCR-XML file. The properties FormatSearchablePdfTextColor, FormatSearchablePdfLayerName and FormatSearchablePdfDTDFolder are supported for this multi-page HOCR XML file. Such a multi-page HOCR XML file can be generated for exmaple with CIB format and the output format FormatHocr.
Properties:
Property description |
Type |
Functionality |
Kind |
OutputFormat |
String |
FormatSearchablePdf |
Set |
CurrentProgress (from CIB pdf toolbox 1.24.0 onwards) |
String |
This property can be used to check the progress of the text recognition process of CIB ocr. The CIB pdf toolbox transfers the content of the method CibOcrJobGetProgress of the CIB ocr module unchanged. The
property contains a string with the structure: For details see „Technical manual CIB ocr“, chapter „CibOcrJobGetProgress“ |
Get |
DictionaryWorkSpace |
String |
This property allows to set the path for the data required by CIB ocr. |
Set |
FormatSearchablePdfShowText |
String |
It can be definied whether the text inserted in the output PDF is visible or not. „1“ Text is visible „0“ Text is not visible (default) |
Set |
FormatSearchablePdfRemoveImages |
String |
It can be defined whether the images are removed from the output PDF or not. Setting this property is only possible if "HocrInputData" is empty and is only useful in conjunction with "FormatSearchablePdfShowText=1". Then the images are replaced by visible text in the output PDF. „1“ Images will be removed „0“ Images will be maintained (default) |
Set |
PdfVersion (from version 1.6.116b onwards) |
String |
The PdfVersion property can also be set optionally for OutputFormat=FormatSearchablePdf. Then the created PDF corresponds to the specified PDF/A standard. Note: this is currently only supported in combination with FormatSearchablePdfShowText=0. Possible values: PDF/A-1b PDF/A-2b PDF/A-3b |
Set |
HocrInputData (from version 1.9.0, multi page format from 1.10.0 onwards) |
String |
This string gives the possibility to import the hocrdata directly from the toolbox (instead of extracting them from the images of the PDF document). If this string is empty (default), it will not be used. Otherwise it includes a list of memory addresses and lengths for strings containing the hocrdata. It must be in the following format: Syntax: HocrInputData ::= <OneHocrFile> [“;“ <OneHocrFile>] ... OneHocrFile ::= “{” <Pagenumber> “};” <MemoryBlocks> MemoryBlocks ::= [<MemoryBlocks-Delimiter> “;”] <MemoryBlock> [<MemoryBlocks-Delimiter> <MemoryBlock>] ... MemoryBlock ::= <Address> <MemoryBlock-Delimiter> <Length> MemoryBlock-Delimiter ::= An individual symbold that is not equal to ‚;‘ and ‚\0‘, e.g. ‚#‘ or ‚?‘, better not to use numbers or characters either. Pagenumber ::= Page number of the page for which the hocrdata are specified. Address :== A decimal number that specifies the address of a memory block for the hocrdata. Length ::= A decimal number that specifies the length of a memory area for the hocrdata. Example: HocrInputData=“{1};?;111?100?222?200;{2};113?100;{3};+;300+100+400+200“ means: Page 1 has hocr data in the memory areas (address, length) (111, 100) and (222, 200); page 2 has hocr data in the memory areas (113, 100); page 3 has hocr data in the memory areas (300, 100) and (400, 200). From CIB pdf toolbox 1.10.0 onwards. a multi-page format is also possible: If the first character is not equal to "{", only one XML HOCR file is specified. This can consist of several individual XML HOCR pages. The file has to be in a special format, such as generated by CIB format with the property OutputFormat=FormatHocr. |
Set |
HocrOutputFilename (from version 1.9.0 onwards) |
String |
If the string is empty, no hocr data is written out (default). If the string is not empty, all used hocr data will be written in the file with this filename as multi-hocr file. The line "<!-- CIB:page=page number -->" is written before each individual "hocr part", where "page number" is the page number for the hocr part. (e.g. "<!-- CIB:page=3 -->" = Hocrdata for page 3). Texts like 'CIB ocr testlicense' are removed from the hocr parts. |
Set |
OCRDebug |
String |
This property is only relevant for technical test purposes. It controls the output of images from the PDF. Possible values: „1“ The intermediate steps of barcode extraction using OCR are output as individual files. „0“ No output of intermediate steps (default) For every single image in the PDF document, which was transferred to the CIB Ocr Dll, several files are output:
The files are written to the same directory as the output file. The names of these files have the following form: “output-file”__Page_”page-number”_Image_“image-number“_“file-extension“ For the “file extension” applies:
Example: If the output document is "Output.xml", the following files are output for the 4th image of the 3rd page: Output.xml__Page_3_Image_4.bmp |
Set |
FormatSearchablePdfTextColor (from version 1.10.0 onwards) |
String |
This property is only used if OutputFormat=FormatSearchablePdf and FormatSearchablePdfShowText="1" and the first character of HocrInputData is not equal to '{'. It specifies the color for the inserted text. Possible values:
For example, "255;0;0" is red. |
Set |
FormatSearchablePdfLayerName (from version 1.10.0 onwards) |
String |
This property is only used if OutputFormat=FormatSearchablePdf and FormatSearchablePdfShowText="1" and the first character of HocrInputData is not equal to '{'. It indicates (if specified) the PDF layer name (in Adobe Reader) for the inserted text. Possible values:
|
Set |
FormatSearchablePdfDTDFolder (from version 1.10.0 onwards) |
String |
This property is only used if OutputFormat=FormatSearchablePdf and FormatSearchablePdfShowText="1" and the first character of HocrInputData is not equal to '{'. It is an auxiliary property and specifies (if specified) the local path for the XHTML DTD file xhtml1-transitional.dtd. The background is: The XML parser returns a NetAccessorException. And the W3C says that the calls to the DTDs should be stored locally. Possible values:
|
Set |
FormatSearchablePdfConversionMode (from version 1.18.0 onwards) |
String |
This property defines the form in which the images contained in the PDF are transferred to CIB ocr.. Possible values: FormatSearchablePdfConvertImages FormatSearchablePdfConvertPages FormatSearchablePdfConvertAuto |
Set |
FormatSearchablePdfUseRotationHint (from version 1.18.0 onwards) |
String |
If this property is set, the information about a rotation is passed to CIB ocr for each page of the PDF. This improves the recognition rate of CIB ocr for rotated pages. For this purpose the CIB pdf toolbox uses the CIB ocr property ImageRotationAngle. Possible values: 0 Previous behavior 1 Transfer of information about the page rotation to CIB ocr. (Default) |
Set |
FormatSearchablePdfReplaceText |
String |
This property is only valid for OutputFormat=FormatSearchablePdf If the property FormatSearchablePdfReplaceText IS NOT set then the original behavior will be used: pdf toolbox will always add new CIB HOCR content without removing existing ones. If the property is set as FormatSearchablePdfReplaceText=1 then pdf toolbox will remove existing invisible CIB HOCR content from the processed document before adding a new one.
The new property FormatSearchablePdfReplaceText can also work in conjunction with TextSelectionFilter: if FormatSearchablePdfReplaceText=1 and TextSelectionFilter contains some filter then this filter will be used to remove text from the original document before adding new HOCR text
Examples: 1. OutputFormat=FormatSearchablePdf FormatSearchablePdfReplaceText=1 - will remove existing CIB HOCR text before adding new HOCR text 2. OutputFormat=FormatSearchablePdf FormatSearchablePdfReplaceText=1 TextSelectionFilter={"groups":["any_invisible"]} - will remove any invisible text (including CIB HOCR) before adding new HOCR text |
|
12. Technical interfaces
This chapter gives a quick overview about the available API and its parameters. In general, you can use the CibPdfSetProperty function to set your desired parameters in the CIB pdf toolbox and then call a CibPdfJoin or CibPdfMerge function.
CibPdfSetPropertyCibPdfGetProperty
CibPdfJoin
CibPdfMerge
CibPdfGetVersion
CibPdfGetError
CibPdfGetErrorText
CibPdfGetLastError
CibPdfGetLastErrorText
CibPdfEventNotifier
CibPDFshowPageSetupDialog
CibPdfShowPrintDialog
CibPdfShowPrintSetupDialog
MemoryOutputCallback
AbortDocCallback
CibPdfJobCreate
CibPdfJobFree
CibPdfJobMerge
CibPdfJobJoin
CibPdfJobShowPrintDialog
CibPdfJobShowPrintSetupDialog
CibPdfJobShowPageSetupDialog
CibPdfJobGetProperty
CibPdfJobSetProperty
CibPdfJobGetPropertyW
CibPdfJobSetPropertyW
CibPdfJobGetError
CibPdfJobGetErrorText
CibPdfJobCancel
CibPdfSetProperty
BOOL EXPORTFUNC CibPdfSetProperty (const char* a_pOptionName,
void* a_pOptionValue)
This function sets properties for the CIB pdf toolbox. The properties InputFilename, OutputFilename and Data must be set before calling CibPdfMerge. The function returns TRUE if no error has occurred. Otherwise FALSE will be returned.
Parameters:
Type |
Variable |
Description |
char* |
a_pOptionName |
Name of the desired configuration parameter |
void* |
a_pOptionValue |
Value of the desired configuration parameter |
|
|
Attention: Notice the data type of the respective value. |
CibPdfGetProperty
BOOL EXPORTFUNC CibPdfGetProperty(const char* a_pOptionName,
void* a_pOptionValue, long a_lBufferLength)
This function can be used to query the currently set properties of the CIB pdf toolbox component. The function returns TRUE if no error occurred. Otherwise FALSE will be returned.
Parameters:
Type |
Variable |
Description |
char* |
a_pOptionName |
Name of the desired configuration parameter |
void* |
a_pOptionValue |
Value of the desired configuration parameter |
long |
a_lBufferLength |
Length of the buffer for the option content |
CibPdfJoin
BOOL EXPORTFUNC CibPdfJoin()
This method starts the join functionality. With the function CibPdfSetProperty at least the properties InputFilename and OutputFilename have to be set before. When joining encrypted PDFs, the corresponding owner password has to be specified for each file. This can be done using the property EncryptOwnerPassword. The function has no parameters. It returns TRUE if no error occurred when executing this function. Otherwise FALSE will be returned.CibPdfMerge
BOOL EXPORTFUNC CibPdfMerge()
This method starts the merge process. With the function CibPdfSetProperty at least the properties InputFilename, OutputFilename and Data have to be set before. The function has no parameters. It returns TRUE if no error occurred when executing this function. Otherwise FALSE will be returned.CibPdfGetVersion
BOOL EXPORTFUNC CibPdfGetVersion(unsigned long *a_iVersion)
The function returns the current version number of the Cib pdfm component. This allows you to ensure that a minimum version is available in your application, for example, if you use special program features that have only been made available since a certain release. The function returns TRUE if no error occurred. Otherwise FALSE will be returned.
Parameters:
Type |
Variable |
Description |
unsigned long & |
a_lVersion |
a_lVersion returns the current version number of the CIB pdfm component. The unsigned long-value returns the information in two ranges. The first two bytes contain the version counter of the main release. The bytes 3 and 4 contain the corresponding current release counter. Depending on the programming language, the high and low ranges have to be considered accordingly. |
CibPdfGetError
BOOL EXPORTFUNC CibPdfGetError (CibPdfHandle a_hJob, int*a_pErrorCode)
With this function the current error text for a job can be queried after a function has been executed.
Parameters:
Type |
Variable |
Description |
long |
a_hJob |
Handle of the request to be executed |
int * |
a_iError |
Placeholder for the current error code |
CibPdfGetErrorText
BOOL EXPORTFUNC CibPdfGetErrorText(int a_iErrorId, char* a_pTextBuffer,
long a_lBufferLength)
This function can be used to query the current error text for a job after a function has been executed. The function returns TRUE if no error occurred while retrieving the error text. Otherwise FALSE will be returned.
Parameters:
Type |
Variable |
Description |
int |
a_iErrorId |
error code |
char |
a_pTextBuffer |
Text buffer for the error text |
long |
a_lBufferLength |
Length of the available text buffer |
CibPdfGetLastError
BOOL EXPORTFUNC CibPdfGetLastError(int *a_iError)
With this function the current error status of the CIB pdf component can be queried after the execution of various functions. The function returns TRUE if no error occurred while executing this function. Otherwise FALSE will be returned.
Parameters:
Type |
Variable |
Description |
int |
a_iError |
Place holder for the current error code |
CibPdfGetLastErrorText
BOOL EXPORTFUNC CibPdfGetLastErrorText(char* a_pTextBuffer,
long a_lBufferLength)
With this function the current error text of the CIB pdf toolbox component can be queried after a function has been executed. The function returns TRUE if no error occurred while retrieving the error text. Otherwise FALSE will be returned.
Parameters:
Type |
Variable |
Description |
int |
a_pTextBuffer |
Text buffer for the error text |
long |
a_lBufferLength |
Length of the available text buffer |
CibPdfEventNotifier
(from CIB pdf toolbox Version 1.24.0 onwards)
To enable the use of callbacks, a derived class must be implemented in the used application for the CibPdfEventNotifier class defined in "CibPdfEventNotifier.h" of the CIB pdf toolbox.
Additionally, their abstract methods
CibPdfEventNotifier::OnPageStart(...) and
CibPdfEventNotifier::OnPageImageOutput(...),
have to be implemented to be able to retrieve the callback data.
The pointer to the instance of the derived class (converted to an integer and represented as a string) is assigned to the "EventNotifier" property.
The method „CibPdfEventNotifier::OnPageStart(...)“is used by the CIB pdf toolbox at the beginning of the processing of each page. It returns the „CibPdfEventPageInfo“ data structure and a flag that can be used to abort further processing.
The method „CibPdfEventNotifier::OnPageImageOutput(...)“ is used by the CIB pdf toolbox after rendering a page and before saving the image. It returns the „CibPdfEventPageImageInfo“ data structure and a flag that can prevent saving the image.class CibPdfEventNotifier
{
public: virtual void OnPageStart(CibPdfEventPageInfo* pageInfo, bool& abort) = 0; virtual void OnPageImageOutput(CibPdfEventPageImageInfo* imageInfo, bool& skipFileOutput) = 0;
};
The "CibPdfEventPageInfo" data structure delivered by the CIB pdf toolbox at the beginning of the processing of each page has the following form:
struct CibPdfEventPageInfo
{
int pageIndex;
size_t pageWidth;
size_t pageHeight;
};
Parameters:
Type |
Variable |
Description |
int |
pageIndex |
Index of the current page (0-based) |
size_t |
pageWidth |
width and height of the current page in pixels and the standard resolution of 72dpi |
The "CibPdfEventPageImageInfo" data structure delivered by the CIB pdf toolbox after rendering a page and before saving the image has the following form:
struct CibPdfEventPageImageInfo
{
int pageIndex;
size_t imageWidth;
size_t imageHeight;
size_t imageStride;
size_t imageLength;
Format imageFormat;
const unsigned char* data;
};
enum Format {fRGB565, fRGB888, fBMP};
Parameters:
Type |
Variable |
Description |
int |
pageIndex |
Index of the current page (0-based) |
size_t |
imageWidth |
The standard parameters of a bitmap in DIB format (DIB = device independent bitmap format) |
char* |
Data |
Complete bitmap in DIB format |
size_t |
imageLength |
Their length in bytes |
CibPDFshowPageSetupDialog
(from CIB pdf toolbox 1.10.0 onwards)
BOOL EXPORTFUNC CibPdfShowPageSetupDialog(int *a_iButtonID);
On Windows this function starts with the standard printer driver dialog of the operating system. With this dialog you can configure the printer driver to be used for printing. This function is interesting for applications that always want to print with a user dialog.Parameters:
Type |
Variable |
Description |
int* |
a_iButtonId |
Returns the ButtonId of the button clicked within the print selection. 1 (COMOD_ID_OK) OK button (à you should call CibPrPrint afterwards) 3 (COMOD_ID_CLOSE) Close button (à the user has changed the printer but does not want to print immediately) 2 (CIB_ID_CANCEL) Cancel button |
The function returns TRUE if no error has occurred.
CibPdfShowPrintDialog
BOOL EXPORTFUNC CibPdfShowPrintDialog(int *a_iButtonID);
On Windows this function starts with the standard page selection/printer driver dialog of the operating system. This allows you to make appropriate printer configurations and page selections that will be taken into account during subsequent printing. This function is interesting for applications that always want to print with a user dialog.
Parameters:
Type |
Variable |
Description |
int* |
a_iButtonId |
Returns the ButtonId of the button clicked within the print selection. CIB_ID_OK OK button (à you should call CibPrPrint afterwards) CIB_ID_CLOSE Close button (à the user has changed the printer but does not want to print immediately) CIB_ID_CANCEL Cancel button |
The function returns TRUE if no error has occurred.
CibPdfShowPrintSetupDialog
(from CIB pdf toolbox 1.10.0 onwards)
BOOL EXPORTFUNC CibPdfShowPrintSetupDialog(int *a_iButtonID);
On Windows this function starts with the standard page selection/printer driver dialog of the operating system. With this dialog, you can configure the printer to be used for the subsequent printing process. This function is of interest for applications that always want to print with a user dialog.
Parameters:
Type |
Variable |
Description |
int* |
a_iButtonId |
Returns the ButtonId of the button clicked within the print selection. CIB_ID_OK OK button (à you should call CibPrPrint afterwards) CIB_ID_CLOSE Close button (à the user has changed the printer but does not want to print immediately) CIB_ID_CANCEL Cancel button |
The function returns TRUE if no error has occurred.
MemoryOutputCallback
COMOD_CALLBACK_TYPE(COMOD_BOOL, MemoryOutputCallbackType) (const char* a_TextOutput, size_t a_Length, void*a_pUserdata, int a_Error)
Callback prototype for data output in memory.
Parameters:
Type |
Variable |
Description |
char* |
a_TextOutput |
The data that is transferred via the callback function. |
size_t |
a_Length |
The number of bytes of the data. |
void* |
a_pUserdata |
Pointer to any user data. Specific type depends on the implementation of the callback function. |
Int* |
a_Error |
Error code which is transferred to the callback function by the caller. |
The function returns FALSE if an error has occurred.
AbortDocCallback
(from CIB pdf toolbox 1.10.0 onwards)
BOOL EXPORTFUNC AbortDocCallback(const ABORTDOCINFO* a_AbortDocInfo, void* a_pUserData)
typedef struct _abortdoc {unsigned long ulCurrentPage;unsigned long ulPageCount;} ABORTDOCINFO;
Callback prototype for data output in memory. The callback is executed after each page of the document with information about current page number and total page number. The conversion is continued by returning the value "true", false causes the conversion to be aborted with return value 1000(userbreak).
Parameters:
Type |
Variable |
Description |
ABORTDOCINFO* |
a_AbortDocInfo |
The data that is transferred via the callback function. |
void* |
a_pUserdata |
Pointer to any user data. Specific type depends on the implementation of the callback function. |
The function returns FALSE if an abort is desired.
CibPdfJobCreate
COMOD_BOOL COMOD_API CibPdfJobCreate(CibPdfJobHandle*a_pJob, const char* a_pReserved)
This method creates a JobHandle, which is then released again via CibPdfJobFree.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_pJob |
Handle of the request to be executed. |
char* |
a_pReserved |
|
The function returns TRUE if no error has occurred. Otherwise
FALSE will be returned.
CibPdfJobFree
COMOD_BOOL COMOD_API CibPdfJobFree(CibPdfJobHandle*a_pJob);
This method releases a JobHandle created with CibPdfJobCreate.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_pJob |
Handle of the request to be executed. |
The function returns TRUE if no error has occurred. Otherwise FALSE will be returned.
CibPdfJobMerge
COMOD_BOOL COMOD_API CibPdfJobMerge(CibPdfJobHandle a_hJob);
This method is used to execute a PDF merge job. The JobHandle has to be created with CibPdfJobCreate previously.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_hJob |
Handle of the request to be executed. |
The function returns TRUE if no error has occurred. Otherwise
FALSE will be returned.
CibPdfJobJoin
COMOD_BOOL COMOD_API CibPdfJobJoin(CibPdfJobHandle a_hJob);
This method is used to execute a PDF join job. The JobHandle must have been created previously with CibPdfJobCreate.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_hJob |
Handle of the request to be executed. |
The function returns TRUE if no error has occurred. Otherwise
FALSE will be returned.
CibPdfJobShowPrintDialog
COMOD_BOOL COMOD_API CibPdfJobShowPrintDialog(CibPdfJobHandle a_hJob, int* a_pButtonID);
On Windows this function starts with the standard page selection/printer driver dialog of the operating system. This allows you to make appropriate printer configurations and page selections that will be taken into account during subsequent printing. This function is interesting for applications that always want to print with a user dialog.
The JobHandle must have been created previously with CibPdfJobCreate.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_hJob |
Handle of the request to be executed. |
Int* |
a_pButtonID
|
Returns the ButtonId of the button clicked within the print selection. 1 (COMOD_ID_OK) OK button (à you should call CibPrPrint afterwards) 3 (COMOD_ID_CLOSE) Close button (à the user has changed the printer but does not want to print immediately) 2 (CIB_ID_CANCEL) Cancel button |
The function returns TRUE if no error has occurred. Otherwise
FALSE will be returned.
CibPdfJobShowPrintSetupDialog
COMOD_BOOL COMOD_API CibPdfJobShowPrintSetupDialog(CibPdfJobHandle a_hJob, int* a_pButtonID);
On Windows this function starts with the printer properties dialog of the respective driver manufacturer of the currently activated printer. With this dialog, you can configure the printer to be used for the subsequent printing process. This function is interesting for applications that always want to print with a user dialog.
The JobHandle must have been created previously with CibPdfJobCreate.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_hJob |
Handle of the request to be executed |
Int* |
a_pButtonID
|
Returns the ButtonId of the button clicked within the print selection. 1 (COMOD_ID_OK) OK button (à you should call CibPrPrint afterwards) 3 (COMOD_ID_CLOSE) Close button (à the user has changed the printer but does not want to print immediately) 2 (CIB_ID_CANCEL) Cancel button |
The function returns TRUE if no error has occurred. Otherwise FALSE will be returned.
CibPdfJobShowPageSetupDialog
COMOD_BOOL COMOD_API CibPdfJobShowPageSetupDialog(CibPdfJobHandle a_hJob, int* a_pButtonID);
On Windows this function starts with the standard printer driver dialog
of the operating system. With this dialog you can set up the printer driver
(Page Setup), which will be taken into account when printing. This function is
interesting for applications that always want to print with a user dialog.
The JobHandle must have been created previously with CibPdfJobCreate.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_hJob |
Handle of the request to be executed |
Int* |
a_pButtonID
|
Returns the ButtonId of the button clicked within the print selection. 1 (COMOD_ID_OK) OK button (à you should call CibPrPrint afterwards) 3 (COMOD_ID_CLOSE) Close button (à the user has changed the printer but does not want to print immediately) 2 (CIB_ID_CANCEL) Cancel button |
The function returns TRUE if no error has occurred. Otherwise
FALSE will be returned.
CibPdfJobGetProperty
COMOD_BOOL COMOD_API CibPdfJobGetProperty(CibPdfJobHandle a_hJob, const char* a_pName, void*a_pValue, size_t a_MaxLength);
With this function the currently set properties of the CIB pdf toolbox
components can be queried.
The JobHandle must have been created previously with CibPdfJobCreate.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_hJob |
Handle of the request to be executed |
char* |
a_pName |
Name of the desired property |
void* |
a_pValue |
Value of the desired property |
size_t |
a_MaxLength |
Buffer length for the option content |
The function returns TRUE if no error has occurred. Otherwise FALSE will be returned.
CibPdfJobSetProperty
COMOD_BOOL COMOD_API CibPdfJobSetProperty(CibPdfJobHandle a_hJob, const char* a_pName, void*a_pValue, size_t a_Length);
With this function the properties for the execution of the CIB pdf
toolbox component can be set.
The JobHandle must have been created previously with CibPdfJobCreate.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_hJob |
Handle of the request to be executed |
char* |
a_pName |
Name of the desired property |
void* |
a_pValue |
Value of the desired property |
size_t |
a_Length |
|
The function returns TRUE if no error has occurred. Otherwise FALSE will be returned.
CibPdfJobGetPropertyW
COMOD_BOOL COMOD_API CibPdfJobGetPropertyW(CibPdfJobHandle a_hJob, const wchar_t* a_pName, const wchar_t*a_pValue, size_t a_MaxLength);
With this function the currently set properties of the CIB pdf toolbox
component can be retrieved.
The JobHandle must have been created previously with CibPdfJobCreate.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_hJob |
Handle of the request to be executed |
wchar-t* |
a_pName |
Name of the property in wchar_t* (UNICODE) |
wchar-t* |
a_pValue |
Value of the property in wchar_t* (UNICODE) |
size_t |
a_MaxLength |
The number of bytes of the data |
The function returns TRUE if no error has occurred. Otherwise FALSE is returned.
CibPdfJobSetPropertyW
COMOD_BOOL COMOD_API CibPdfJobSetPropertyW(CibPdfJobHandle a_hJob, const wchar_t* a_pName, const wchar_t*a_pValue/*, size_t a_Length*/);
With this function the properties for the execution of the CIB pdf
toolbox components can be set.
The JobHandle must have been created previously with CibPdfJobCreate.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_hJob |
Handle of the request to be executed |
wchar-t* |
a_pName |
Name of the property in wchar_t* (UNICODE) |
wchar-t* |
a_pValue |
Value of the property in wchar_t* (UNICODE) |
size_t |
a_MaxLength |
The number of bytes of the data |
The function returns TRUE if no error has occurred. Otherwise FALSE will be returned.
CibPdfJobGetError
COMOD_BOOL COMOD_API CibPdfJobGetError(CibPdfJobHandle a_hJob, int*a_pErrorCode);
With this function the current error status of the CIB
pdf toolbox can be retrieved after the execution of various functions.
The JobHandle must have been created previously with CibPdfJobCreate.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_hJob |
Handle of the request to be executed |
int* |
a_pErrorCode |
Placeholder for the current error code |
The function returns TRUE if no error has occurred. Otherwise FALSE will be returned.
CibPdfJobGetErrorText
COMOD_BOOL COMOD_API CibPdfJobGetErrorText(CibPdfJobHandle a_hJob, char* a_pText, size_t a_MaxLength);
This function can be used to retrieve the current
error text for a job after a function has been executed.
The JobHandle must have been created previously with CibPdfJobCreate.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_hJob |
Handle of the request to be executed |
char* |
a_pText |
Text buffer for the error text |
size_t |
a_MaxLength |
Length of the available text buffer |
The function returns TRUE if no error has occurred. Otherwise FALSE is returned.
CibPdfJobCancel
(from CIB pdf toolbox 1.24.0 onwards)
COMOD_BOOL COMOD_API CibPdfJobCancel(CibPdfJobHandle a_hJob);
With this function the current job of a CIB ocr text
recognition (CibOcrJobGetProgress) can be aborted.
The JobHandle must have been created previously with CibPdfJobCreate.
Parameters:
Type |
Variable |
Description |
CibPdfJobHandle* |
a_hJob |
Handle of the request to be executed |
The function returns TRUE if no error has occurred. Otherwise FALSE is returned.
13. Generally valid Properties
The so-called "properties" or attributes are an essential criteria before calling the actual execution method. All option names mentioned below in plain text are also declared as define in the individual header files of the components. They can also be called by source code via defines. The various internal modules have further special properties, which are described in the individual subchapters
To set the options, the property CibPdfSetProperty is available as well as the property CibPdfGetProperty to retrieve.
Property description |
Type |
Funcionality |
Kind |
AnnotationsFilename (from CIB pdf toolbox 1.4.105 onwards) |
String |
Input file or storage area in XFDF format that contains the comments to be imported to the PDF. This corresponds to the "Import Comments" function in Adobe Acrobat. |
Set |
AnalysisFilename (from CIB pdf toolbox 1.14.4 onwards) |
String |
Writes information about the properties of a PDF page to a log file. Syntax: The analysis file currently only contains information about page size and alignment. Example: There are 2 pages with the specified dimensions in mm and the alignment portrait and landscape. This property can be combined with the property OutputFormat=FormatInfo, so that no output file name has to be specified. |
Set |
AntiAliasing |
String |
Setting the AntiAliasing fcuntionality. 0 No AntiAliasing (default) 2 x2 AntiAliasing functionality for internal and Pango rendering engine. 4 x4 AntiAliasing functionality for internal and Pango rendering engine. (see also RenderingEngine parameters) |
Set |
BookmarkAlignment (from CIB pdf toolbox 1.4.84 onwards) |
String |
„0“ = No insertion of blank pages „1“ = Each copy will be extended by blank pages to an even number of pages Useful for PDF joins without OutputFormat=FormatPrinter only. |
Set |
CallbackPointer |
String |
User data of the callback for feedback after each page. |
Get/ |
ColorDithering (from CIB pdf toolbox 1.4.86 onwards) |
String |
If this property is set, all color values are converted into black and white patterns when output (as bitmap or when printing). The pattern then is derived from the brightness of the color value. Possible values: |
Get/ |
Data |
String |
Specifies the input data source. The data is merged in by the PdfMerge module Syntax: Data=<file type>:<file name> <file type>= empty (CSV will be assumed.) CSV TYP: other file types (e.g. SQL), which are processed via the DataAccess interface. <file name>=file.typ X:\file.typ file.xml;//xpath If the data file (CSV, XML) is a multi-control file, MultiData=1 has to be set. Example: |
Get/ |
DataFileMemoryAddresses |
String |
memory address and length of the data file at memory transfer |
Get/ |
DataFileType |
String |
data type for data source by memory transfer |
Get/ |
DataXmlPath |
String |
input request, e.g. „XML:data.xml;//root/...“ for data source by memory transfer |
Get/ |
DataXslFilename |
String |
name of the XSL transformation file (for transformation of Adobe XFDF form data export) |
Get/ |
DocumentUsedBookmarks (from CIB pdf toolbox 1.4.105 onwards) |
String |
Output of the bookmarks used in a document. For each bookmark, the pages it contains are specified. These can be individual pages and/or one or more page areas. Syntax: <bookmark> ::= „{“ <text> „;“ <page list> „}“ <page list> ::= <pages> | <pages> „,“ <page list> <pages> ::= <number> | < number> „-„ < number> Example: |
Get |
EmbeddedFileOutputFormat |
String |
„None“: the streams of the embedded files are not extracted (Default). „FormatEmbedded“: the streams of the embedded files are written to the metafile. „FormatFile“: the embedded files are extracted to the current working directory. |
Set |
EmbeddedFilesExtract
|
String |
A JSON array of JSON objects that define which files can be exported. A JSON object looks like this: - File: File name as given in the pdf - OutputFilename: Where to save the file |
Set |
EnablePatternsShadings (ab CIB pdf toolbox 1.14.0) |
String |
The property determines if PDF shadings and patterns are rendered as well. 1 PDF shadings and patterns are rendered as well (Default) 0 PDF shadings and patterns are not rendered Required: CIB renderer |
Set |
ExtractEmbeddedFile (from CIB pdf toolbox 1.8.0 onwards) |
String |
By setting this property you can determine that the CIB pdf toolbox extracts an embedded file during a join run.. Possible values: - „zugferd“: Extracting the ZUGFeRD XML (from CIB pdf toolbox 1.9.0 onwards) The name under which the embedded file is written will be transferred via the OutputFilename property. "1" = The information of the embedded files is written to the metafile (name, file size, date of creation and last modification) (default). "0" = No information about embedded files is written to the metafile. |
Set |
ExtractEmbeddedFileInfo |
String |
"1" = The information of the embedded files is written to the metafile (name, file size, date of creation and last modification) (default). "0" = No information about embedded files is written to the metafile. |
Set |
ExtractXmpMetadata |
String |
Enables extracting XMP metadata from a PDF file. The property has JSON syntax. Example: { „1“: „<filenameforfirstpage>“, // extracted
xmp from page 1 } „<number>“ Unpacks the XMP metadata of a specific page „Global“ unpacks the global XMP metadata of the PDF document (from the Catalog Dictionary) „AllPages“ unpacks all pages of XMP metadata. |
|
FieldCaptions. |
String |
dynamic property, labeling of a form field (e.g. FieldCaptions.Radio123) The value of the property is: for Pushbuttons: A list of pushbutton labels separated by the “;" symbol. as an ansi-string or as a Utf8-string. (there can be several pushbuttons with the same name, even with different labels) for radio buttons and checkboxes: a list separated by the “;" symbol indicating the style for each button in the group. The order is the same as for FieldStates (except "Off"). Possible styles are: „n“ = square „u“ = diamond „4“ = check „8“ = cross „H“ = star „l“ = bullet The button is circular when the caption is the bullet. Otherwise the button is square. |
Get |
FieldDimensions. |
String |
dynamic property, coordinates of a form field (e.g.
FieldDimensions.Field123) |
Get |
FieldFlags. |
String |
dynamic property, attributes of a form field (e.g. (z.B. FieldFlags.Field123) The content is a list of properties set for the field “Field123). The following attributes are possible: ReadOnly read-only, write-protected Required required NoExport Ignore this field when exporting the form Multiline several lines (only for text fields) Password protected input (*****) (only for text fields) NoToggleToOff Selection cannot be set to empty (radio button) Radio redundant, see FieldType.<name> Pushbutton redundant, see FieldType.<name> Combo redundant, see FieldType.<name> Edit user defined input allowed (only for combo boxes) Sort sort selection (list and combo boxes) FileSelect field is selection for file name MultiSelect multi selection (only for list boxes) DoNotSpellCheck no spell checking DoNotScroll no horizontal scrolling (limited text length) Comb text in boxes RadiosInUnison switch buttons with the same export value on and off simultaneously CommitOnSelChange Insert selected value immediately (not only when leaving the field) RichText Feld contains „rich text“ (no rtf, but text with some html-tags as <b>,<i>) |
Get |
FieldFont. |
String |
dynamic property, font type and size of the form field text |
Get |
FieldNames |
String |
List of names of form fields in the document, separated by the ";" symbol |
Get |
FieldOptions. |
String |
dynamic property, options of a form field (e.g. FieldValue.Field123) For list and combo boxes, the text entries are separated by the ";" symbol. |
Get |
FieldOrder. |
String |
dynamic property, consecutive number of the form field (unsorted) |
Get |
FieldStates. |
String |
dynamic property, characteristics of a form field (e.g. FieldValue.Checkbox123) |
Get |
FieldType. |
String |
dynamic property, type of a form field (e.g. FieldType.Textfeld123) |
Get |
FieldValue. |
String |
dynamic property, for setting or reading form field contents (e.g. FieldValue.Textfeld123) By setting this property to the PdfMerge module, contents of form fields can be transferred and merged into the PDF. (e.g. FieldValue.Textfield123=Test) (from version 1.4.84 onwards) |
Get/Set |
FillTextOutput (from CIB pdf toolbox 1.27.0. onwards) |
String |
These options have effect only when the output format option is set as: OutputFormat=FormatText (for plain text output), or OutputFormat=FormatHocr (for HOCR text output). When option FillTextOutput is set as 0: The extracted text is only output into the output file. If the output filename is not set within OutputFilename option then error should appear. When option FillTextOutput is set as 1: The extracted text is output into the output file and additionally copied into the output property TextOutput in Utf8 encoding. Note: If FillTextOutput is 1 and OutputFilename is not set then the extracted text is only saved into TextOutput property. |
Set |
FontsEmbedded (from CIB pdf toolbox 1.10.0 onwards) |
String |
If this value is set, all fonts used in the PDF document are embedded in the PDF output document. Possible values: „0“ no embedding (default) „1“ fonts willbe embedded Note: |
Set |
FontSubstitution (from CIB pdf toolbox 1.10.0 onwards) |
String |
The property is valid if FontsEmbedded=1 or PdfVersion=PDF/Axx. All fonts not available in the system must be replaced. You can use this property to determine which fonts are used for the replacement. Syntax: In detail: o Fonts existing in the target system are embedded without replacement. o Fonts that do not exist in the target system are replaced. Is the font in the FontSubstitution property list? -
Yes: -
No: Example: Notes: o The CIB pdf toolbox only makes a font substitution if the other font is compatible. I.e. a symbolic font (e.g. Wingdings) will not be replaced by a nonsymbolic one (e.g. Times New Roman) or vice versa, a CID font will not be replaced by a non-CID one or vice versa. o In the case of a font substitution that is not performed but set by property, it ends with return value 352. o Due to font-specific properties, e.g. letter width, the layout can be changed in the case of a font substitution. The user must check this for correctness. |
Set |
FontWorkSpace |
String |
Path to the directory containing the fonts to be used when rendering the PDF in image format. It is used by both the internal and Pango rendering engines (see also Property RenderingEngine). |
Set |
FormfieldNamePrefix |
String |
Prefix for all form fields of a document, or a list of prefixes separated by the ";" symbol for the documents involved in the Join. |
Set |
GeneratedDocumentCount (from Version 1.4.83 onwards) |
String |
Delivers the amount of generated output documents. Normally "1" is returned, except for MultiOutput=1 when multiple output PDFs are created. In case of an error, i.e. abort and no output at all, "0" is returned. |
Get |
GeneratedPageCount (from Version 1.8.1 onwards) |
String |
Delivers the amount of pages printed. When printing, the number of copies made is counted. When a file is output, the number is identical to that from PageCount. In case of an error, i.e. abort and no output at all, "0" is returned. |
Get |
GetFieldInfo |
String |
This property can be used to query the form fields. Possible Values: „1“ The form fields can be be querried „0“ „“ No query possible (default) |
Get/ |
GetPageInfo |
String |
This property can be used to supply the GET property "PageInfo.<page>". Possible Values: „1“ This property can be used to supply the GET property "PageInfo.<page>".. „0“ |
Get/ |
ImageInfo |
|
Get a description about images in a PDF file in JSON format. |
Get |
ImagePdfCreation |
String |
Possible Values: „0“ or empty: Property has no effect. „1“ CIB pdf toolbox uses CIB renderer to generate content of PDF pages as graphics. |
Set |
ImagePdfCreationPreserveText |
String |
If the PdfAFallback case occurs (see Chapter 5.1.4.1.), text contents from the input file can be saved using HOCR Export and transferred to the output file by setting this property. Possible Values: „0“: Property has no effect. „1“: Text contents of the input file are transferred to the output file |
Set |
IndDCAntiAliasing |
String |
No longer in use “2” – Enable x2 anti-aliasing functionality for internal rendering engine “4” – Enable x4 anti-aliasing functionality for internal rendering engine (see Proprety RenderingEngine); Default: "0" or empty (no anti-aliasing is carried out) |
Set |
HiddenPages |
String |
CIB-internal property, currently only supported by CIB image. A CIB viewer uses this property to specify which pages are to be hidden when displayed by a CIB viewer. This information is stored in the PDF using CIB means. (Analogous to the hiding of PowerPoint slides in PowerPoint). |
Set |
IgnoreTemporaryFontFailure (from CIB pdf toolbox 1.8.0) |
String |
This property can be used to control the reaction to errors during the temporary installation of fonts from the PDF. Possible Values: 1 Errors are ignored and processing continues 0 Errors are acknowledged with a return value, e.g. 350, and processing is terminated. (default) |
Set/ |
IncludeInvisibleText |
String |
This property controls whether invisible PDF text (rendering mode = 3) is output by the CIB pdf toolbox or not. Possible Values: „1“ Invisible PDF is displayed in the same way as visible PDF text for certain toolbox calls. „0“ Invisible PDF text is not output with these toolbox calls. (= default) This property is only effective for subsequent Toolbox calls: a) For the toolbox text search with PdfSearchText="...". b) When the Pdf file is output in the output formats "FormatText" or "FormatCsv". c) When the Pdf file is output in the "FormatXfdf" output format if the "RegionTemplate" property is not empty. d) For metafile output for CIB webview (OutputFormat is "FormatWebview"). |
Set |
InputFilename |
String |
Input file or a list of input files or pairs separated by ";" {x};y from page specification(s)/input file or empty page(s) EMPTY[:width(mm), height(mm)]. InputFilename= {Odd};Document1.pdf;EMPTY:210,297; {5,4,1-3};Document2.pdf;EMPTY means that all odd pages of document1.pdf, a blank page of width 210 mm and height 297 mm, the pages 5, 4, 1, 2 and 3 of document2.pdf and a blank page with the width and height of the current last page (page 3 of document2.pdf) are joined in exactly this order.
Syntax: InputFilename ::= <input file> [";" <input file>]... InputFilename ::= [<Page Specifications> ";"] (<Filename> | <Memory Blocks> | <Blanks> | <Memory Block Delimiter>) Page references ::= "{" <page reference> ["," <page reference>]... „}“ Page reference ::= "All" | "Even" | "Odd" | "First" | "Last" | <number> | (<start number> "-" <end number>) Blank page ::= "EMPTY" [":" <Width_in_mm> "," <Height_in_mm>] Memory blocks ::= <Memory block> [<Memory block delimiter> <Memory block>]... Memory block ::= <Address> <Memory block delimiter> <Length>
A <memory block delimiter> is a single character not equal to ";", which if possible does not occur in a file name, e.g. "#", "?". Address and length are decimal numbers |
Get/ |
InputMemoryAddress |
String |
Pairs xxx?yyy of memory address/length Note: |
Get/ |
InsertEmptyPageInDuplex (from CIB pdf toolbox 1.4.83) |
String |
„0“ = Do not insert duplex blank pages during printing (default) „1“ = When duplex printing PDF documents with the CIB pdf toolbox, blank pages are automatically inserted between the merged PDF documents if there are an odd number of pages. These separation points are identified by evaluating the stored marks. These marks are set via the property JoinHistory. (further details, see Property JoinHistory) |
Get/ |
InsertEmptyPageBetweenRtfBookmarks (from CIB pdf toolbox 1.4.83) |
String |
“0” = Do not insert duplex blank pages during printing (default) „1“ = When duplex printing PDF documents, a blank page is inserted between the places where an RtfBookmark changes or where a join was made (see Property JoinHistory), if the following content would be printed on a back side. |
Get/ |
JoinHistory (from CIB pdf toolbox 1.4.83) |
String |
„0“ = The CIB pdf toolbox does not set a marker at the page transitions where it is merged from several individual documents. „1“ = The toolbox marks this position(s).
Note: This makes it possible to make a later printout in duplex mode with automatically inserted blank page. See also Property InsertEmptyPageInDuplex and InsertEmptyPageBetweenRtfBookmarks
The default value is 1 |
Get/ |
StartPage |
String |
This property can be used to store the page number at which the PDF is opened when displayed. The number is stored in the PDF and evaluated when displayed by Adobe Reader, CIB jView or CIB image. |
Set |
OpenSize (from CIB pdf toolbox 1.13.5) |
String |
Specifies the zoom level in the PDF viewer window when opening the PDF file. „Standard“ Use default setting of the PDF display program (Default) „Fit“ Adjust to window height „FitH“ Fit to window width Only applies if StartPage is also set. |
Set |
PartialDocumentAlignment (from CIB pdf toolbox 1.4.84) |
String |
„0“ = No insertion of blank pages „1“ = Each document part is extended by blank pages to an even number of pages. Only useful for PDF joins without OutputFormat=Printer. |
Set |
PdfPrintFontCleanupInterval (from CIB pdf toolbox 1.4.95) |
String |
Specifies a time interval after which the CIB pdf toolbox removes fonts from the font list. This can prevent fonts from being deleted from the font list too early. Unit: Hours With each call the CIB pdf toolbox checks the font list. This contains the fonts that have not yet been cleared with a timestamp. All fonts older than the FontCleanupInterval are removed from the list. If CibPdfMerge/ CibPdfJoin/CibPdfPrint is called repeatedly in the same process, the font list is only checked if at least 1 hour has passed since the last call. |
Set |
LicenseKey |
String |
License key |
Set |
LicenseCompany |
String |
Licensee |
Set |
MaxResolution (since CIB pdf toolbox 1.5.111) |
String |
The size of graphics in the metafile can be limited by specifying a maximum resolution (in dpi). This has an effect on the quality (for example when zooming), but the metafiles become smaller. Default: Original resolution is kept. In Acrobat, this feature is available under "Extended/Pdf Optimization" and is called "Bicubic recalculation to ... dpi for images from ... dpi". The CIB pdf toolbox performs the resampling only when saving as metafile, not when saving as PDF. Furthermore, a simpler (non-bicubic) resampling algorithm is used. |
Set |
ResolutionThreshold (since CIB pdf toolbox 1.5.111) |
String |
All bitmaps in the document that have a higher resolution than ResolutionThreshold (in dpi) are scaled down to MaxResolution and then output. This is independent of the resolution of the output medium (bitmap, printer, metafile). If only MaxResolution is set, then all images with a higher resolution will be downscaled to MaxResolution. |
Set |
MemoryOutputCallback |
String |
Address of the callback function for the output document by memory transfer. For the interface description, see chapter "MemoryOutputCallback". |
Get/ |
MemoryOutputUserdata |
String |
Userdata of the callback function for the output document by memory transfer. |
Get/ |
MetaFilename |
String |
Name of the metafile, which is displayed with the CIB viewer. |
Set |
MultiData |
String |
„1“= Data file is a multi-control file. |
Get/ |
MultiOutput |
String |
„1“= Create a separate output file for each data record. |
Get/ |
NeedAppearances |
String |
„1“= Acrobat rebuilds the form fields when you open them. |
Get/ |
OutputFilename |
String |
File name of the output document. |
Get/ |
OutputFormat |
String |
(None): Document is saved via OutputFilename.
The output format is defined by the property "EmbeddedFileOutputFormat".
(since CIB pdf toolbox 1.4.81) Also for this output format the memory interface is supported from CIB pdf toolbox 1.4.87 on. If the contents of form fields are to be transferred
to the text output, the property FlattenFormfields=1 must be set. (since CIB pdf toolbox 1.4.90)
(since
CIB pdf toolbox 1.4.105) „FormatSearchablePdf“: Text contained in graphics is extracted as text. (since CIB pdf
toolbox Version 1.6.116) „FormatBarcodeXml“: The barcode information read from the PDF via the "BarcodeInfo" property is output in XML format. (since
CIB pdf toolbox 1.8.0) „FormatBarcodeCsv“: The barcode information read from the PDF via the "BarcodeInfo" property is output in CSV format. (since
CIB pdf toolbox 1.8.0) „FormatInfo“: Global document properties are read from the PDF using PDF join. (since CIB pdf toolbox 1.6.116f) “FormatPrinterCups”: Print control via CUPS. Only available for Linux/Unix. (see chapter 14.1.2 "Printing via CUPS" )
„FormatTiff“: Creates a graphic file in Tiff format. „FormatPng“: Creates graphic file in PNG format. (since CIB pdf toolbox Version 1.4.102)
(since CIB pdf
toolbox Version 1.4.102) „FormatWebview“: Output format for display in CIB doXiview.
“FormatWebP“: Creates graphic file in WebP format (uses lossy and non lossy compression). (since CIB pdf toolbox Version 1.9.0) „FormatJpegXR“: Creates a graphic file in JPEG extended range format. „FormatBmp“: Creates a graphic file in BMP format. (since CIB pdf toolbox Version 1.8.5a) „FormatBmpLz4“: Generates graphic file in BMP format, where data is compressed
according to lz4 standard. „FormatImage“: During a rendering process several output graphic formats are
generated. These must be raster graphics formats.
„FormatSvg“:
Output of a graphic file in SVG format (Scalable Vector Graphics).
”FormatAnalyse”: The verification process for verifying the signature is always performed completely and the SignedDocument.xxx properties are set for the signature. This allows you to track which processing steps were successful and which were not. (since CIB pdf toolbox Version 1.6.115)
“FormatExtractImages”: If this output format is specified, all Image-XObjects contained in the input PDFs are exported. The output is in TIFF format or (for certain Pdf image objects) in JPEG format under the file name specified in OutputFilename. (since CIB pdf toolbox Version 1.4.113) „FormatCsv“: Text extracted from the PDF is output as CSV file. |
Get/ |
OutputRtfBookmarkNames |
|
If the OutputRtfBookmarkNames=1 option and PageSelection option is set using CIB bookmark, then the output image names contain bookmark names: The format is OutputRtfBookmarkNames=0: <OutputFilename> - <PageNumber> example: out-000001.png The format is OutputRtfBookmarkNames=1(extended output): <OutputFilename> - <RtfBookmarkName> - <CopyNumber> - <PageNumber> - <PageNumber>…. example: out-AUF1-0000-0000-00001.png |
|
PageCount |
String |
Number of pages in the document, decimal number as string. |
Get |
PageFieldNames.<page> |
String |
Returns the form fields of each page. For example, PageFieldNames.0 contains the form fields of the first page. |
Get |
PageInfo.<page> |
String |
Dynamic property in which information about a page is returned (width, height and rotation). (Property GetPageInfo must be set) E.g. PageInfo.1 contains the information about the second page |
Get |
PdfDocPropertyEncoding |
String |
“” = no Encoding (default) “Base64” = Base64 Encoding |
Get/ |
PdfDocProperties |
String |
Returns the names, separated by ";", of all user-defined document properties. |
Get |
PdfDocProperties |
String |
Set new or modify custom document properties. |
Set |
PdfDocProperty.<name> (since CIB pdf toolbox 1.4.78) |
String |
Dynamic property, reading or setting the value of the user-defined document property whose names are supplied via the “PdfDocProperties” property. The value is encoded according to the "PdfDocPropertyEncoding" property. Attention: new document properties must be made known in advance via the "PdfDocProperties" property. If unknown document properties are specified, the CIB pdf toolbox returns Error code 99. |
Get/ |
PdfLinearized |
String |
Control whether the output PDF is optimized for fast display on the web. Possible values: "0" no optimization (default). "1" Optimization is performed. |
Get/ |
PdfSearchIgnoreCase |
String |
Control whether the search in the PDF is case sensitive. Possible values: "0" not case-sensitive (default) "1" case-sensitive search |
Set |
PdfSearchFont |
String |
Set a specific font. A subsequent text search will only return texts that appear in the document with this font. Example: PdfSearchFont="CourierNewPS-ItalicMT" means that only text passages in the document that use this font will be searched for. Caution: The font name must match the font name in Acrobat Reader's document properties. |
Set |
PdfSearchResult |
String |
Returns the location of the string in the document. Each found location is described by a sequence of rectangles. These rectangles indicate the exact position of the searched string in the page text. A rectangle is indicated by: <page>,<left>,<top>,<right>,<bottom>. If a found location extends over several lines, a sequence of rectangles separated by semicolons is returned. Examples: PdfSearchResult= "1,500,100,600,110;1,50,111,100,121" means that the search text on page 1 extends over two lines. Once from (500,100) to (600,110) and from (50,111) to (100,121). If the search text occurs more than once in the document, the different places where it is found (indicated by {}) are listed next to each other. "{1,500,100,600,110;1,50,111,100,121};{2,500,100,600,110;2,50,111,100,121}" means that the search text also appears on page 2 from (500,100) to (600,110) and from (50,111) to (100,121). A finding place can also extend over several pages. A result like: "1,500,750,600,760;2,50,50,100,60" means that the reference on page 1 goes from (500,750) to (600,760) and continues on page 2 from (50,50) to (100,60). |
Get |
PdfSearchResultContext (since CIB pdf toolbox 1.4.80)
|
String* |
Returns the location of the string in the document with its context. Character string as described in “PdfSearchText” and context as described in “PdfSearchContext”. The search result is structured as follows: ={<Find1>};{<Find2>};... <Location> = {<Context>};<Rectangle1>;<Rectangle2>;... <Rectangle>= see PdfSearchResult <Context> = <Before Context> <Search Chain> <After Context> If there are not enough characters in the document to fill the defined pre- or post-context (e.g. at the beginning or end of a document), spaces are filled in. Example: Search string=children, pre-context=3, post-context=5 returns the result: {{children to};2,214,967,246,836,243,862,256,086}{{{children not};2,202,192,336,836,231,087,346,086} The PdfSearchResult property continues to be additionally assigned. |
Get |
PdfSearchText |
String |
Set the searched string in the document. This can also be a longer text passage. |
Set |
PdfSearchContext (since CIB pdf toolbox 1.4.80) |
String |
Set a context for the searched string, which is output as a search result. ="m;n" m= Number of characters before n= number of characters after the searched string If only a number is specified, the characters after the search string are used. |
Set |
PdfVersionInfo (ab CIB pdf toolbox 1.18.0) |
String |
This property returns the PDF version and special version of the document. The output is in JSON format. example: {"Version": "1.4", "SpecialVersions":["PDF/A", "PDF/X"]} The PDF document has PDF version 1.4 and it also meets the PDF/X and PDF/A specifications. |
Get |
FirstPage LastPage |
String |
Restrict the text search (PdfSearchText) or the text output (OutputFormat=FormatText) to one page area. Example: FirstPage=1 LastPage=3 Only pages 1 to 3 are edited. If the LastPage specification is missing, the range goes to the end of the document. |
Set |
PdfSecurityMethod |
String |
Possible values: „“ = no security method „Standard“ = method is „adobe standard security“ |
Get |
PngCompressLevel (ab CIB pdf toolbox 1.4.105) |
String |
Control for the degree of compression of the graphic when saving. The writing speed can be increased by decreasing the compression (and thus increasing the file size). For example, if the file size is doubled, the file is written five times faster. Possible values: 1 Default value for PNG compression 0 No compression 9 Maximum compression 2 Default |
Set |
PrefixDelimiter” (ab CIB pdf toolbox 1.3.62) |
String |
The parameter - prefix delimiter defines a separator between alias and variable name and switches the prefix mechanism on permanently. By setting the parameter -prefix-delimiter, the variables are kept unique when using multi-node systems. (identical to CIB merge-prefix-delimiter) Default=empty |
Set |
PrintCentered |
String |
If the property is set to "1", the page (in x and y direction) is centered with respect to the printable area (not the paper). (default) If this property is set to "0", no centering takes place. |
Get/ |
PrintScaling |
String |
Scaling options of the pages to the print area: PrintScaleNone - The PDF page is not scaled to printer limits. This means that texts and graphics are cut off if they are outside the print page size. The upper left corner of the PDF page corresponds to the upper left corner of the printable area - not the paper. If the PDF page is not in the same page format as the paper, the upper left corner of the PDF page refers to the rotated print page.(default) PrintScaleDown - larger paper is scaled down to the printable area PrintScaleFit - the paper is scaled to fit the printable area, i.e. larger paper is reduced and smaller paper is enlarged |
Get/ |
Progress |
String |
Returning a JSON-description of current progress of the current running JOB. This property can be retrieved from a different thread as the thread in which the current execute is running. The JSON description consists of the Keys “AmountSteps” and “CurrentStep”. AmountSteps defines, how many internal bigger steps are done and the CurrentStep defines how many Steps were already done. |
Get |
RegenerateXMP (since CIB pdf toolbox Version 1.6.116f) |
String |
"0": Nothing will be done. (default) „1“: Updates XMP data in the PDF from the “DocInfo” values. |
Set |
RenderingEngine (since CIB pdf toolbox Version 1.7.0)
|
String |
"Internal" - Internal rendering engine is used (default for Unix systems). "WinGDI" - Windows rendering engine is used (default for Windows systems). "CIBRenderer" - Pango-Cairo rendering engine is used.(Default für Unix- und Windows-Systeme) |
Set |
TraceFilename |
String |
Specifies where the Toolbox log messages are output to. |
Get/ |
RegionTemplate |
String |
The property is used to pass the name of the XFDF file that contains the areas (rectangles) from which text is to be extracted. The extracted text is written to an XFDF or CSV file. Prerequisite: OutputFormat=FormatXfdfWithAnnots RegionTemplate=<name>.xfdf |
Set |
RegionThreshold |
String |
The property specifies the percentage of a character that belongs to the region. If a character extends into the region at a lower percentage than specified here, it does not belong to the region. RegionThreshold=<integer> Condition: OutputFormat=FormatXfdfWithAnnots and use of RegionTemplate |
Set |
SvgImageBounds (since CIB pdf toolbox Version 1.20.0) |
String |
This property can be used to limit the maximum resolution (and thus the size of the output of the rendering process) for SVG graphics.
Possible value: A JSON string with the following parameters/values: { "MinImageHeight": 50, // The minimum height of the input graph at which this algorithm takes effect, default: 50 "MinImageWidth": 50, // The minimum width of the input graphic at which this algorithm takes effect, default: 50 "ResolutionThresholdJpeg": 180, // Threshold value above which the size of the JPEG graphic is reduced. The size is reduced to the value from "MaxResolutionJpeg" (here: 150 DPI). "ResolutionThresholdPng": 180, // Threshold value above which the size of the PNG graphic is reduced. The size is reduced to the value from "MaxResolutionPng" (here: 150 DPI). "MaxResolutionJpeg": 150, // If the threshold value from ResolutionThresholdJpeg is exceeded, the JPEG graphic is downscaled to 150 DPI. "MaxResolutionPng": 150, // If the threshold value from ResolutionThresholdPng is exceeded, the PNG graphic is downscaled to 150 DPI. } |
Set |
TempPath (since CIB pdf toolbox Version 1.20.0) |
String |
The path specified in this property is used to store: - temporary font files - the list of installed fonts - temporary Postscript pages (for Prostscript printing) Other paths, such as to the output file directory, are not affected by this property. The path must point to a valid directory. It can be a relative or absolute path. |
Set |
GraphicLayerInfo (ab CIB pdf toolbox Version 1.25.0) |
String |
This property reports which graphics are found in the PDF during the rendering process. The output is in JSON format Required: OutputFormat=FormatText | FormatWebview | FormatJavaView RenderingEngine=CIBRenderer. The output depends on the content of the PageSelection property: PageSelection empty: GraphicLayerInfo contains the information for the whole PDF. PageSelection set: GraphicLayerInfo contains the information for each selected page. Example: PageSelection empty: {"stats": {"inlineImageCount":9,"externalImageCount":3,"externalImageIdents":[10,15,20]}} PageSelection set to “1-2”: {"stats": [ {"inlineImageCount":0,"externalImageCount":1,"externalImageIdents":[10]}, {"inlineImageCount":3,"externalImageCount":2,"externalImageIdents":[15,20]}]} |
Get |
TextLayerInfo (since CIB pdf toolbox Version 1.18.0) |
String |
This property reports which text groups are found in the PDF during the rendering process. The output is in JSON format The following text groups are possible: any_visible – Any visible text simple_invisible – Invisible text, not specially marked cibocr_invisible – Invisible text, marked by the CIB pdf toolbox as CIB_HOCR others_invisible – Invisible text, marked by other PDF processors Example: {”groups”: [”any_visible”, “simple_invisible”, “cibocr_invisible”, “others_invisible”]}
Note: OutputFormat must be on FormatText, FormatWebview or FormatJavaView or must be set RenderingEngine=CIBRenderer for graphic formats. The PageSelection property influences the output format of the
TextLayerInfo property.
Examples: No PageSelection set: PageSelection is set to 1-3, Page 1 contains only visible text, Page 2 contains visible and simple invisible text Page 3 contains no text at all: |
Get |
TextMark (since CIB pdf toolbox Version 1.37.0) |
String |
The property works only for output format FormatText and works in conjunction with TextSelectionFilter. If the value of TextSelectionFilter is set as: TextSelectionFilter={"groups":["marked_invisible"]} Then CIB pdf toolbox outputs only invisible text which is marked with special tag, specified by TextMark property. For other groups in TextSelection filter the property TextMark is ignored CIB pdf toolbox extracts text, which is marked in pdf content stream with special tag: CIB_HOCRerty. TextMark is ignored. Example: CibRsh.exe OutputFormat=FormatText TextSelectionFilter= {"groups":["marked_invisible"]} TextMark=CIB_HOCR -fj input.pdf output.txt |
Get |
TextOutput (since CIB pdf toolbox version 1.37.0) |
String |
If we set FillTextOutput=1 then the output property TextOutput is filled by text in Utf8 encoding. |
Get |
TextSelectionFilter (since CIB pdf toolbox Version 1.18.0) |
String |
The property IncludeInvisibleText can be configured via TextSelectionFilter, i.e. it controls in detail which types of visible and invisible texts are output. It has JSON format and, if
set, overrides the specifications from IncludeInvisibleText. In addition to the simple text groups any_visible, simple_invisible, cibocr_invisible, others_invisible (for details see TextLayerInfo property), composite text groups can also be used: any_invisible – any invisible text (simple_invisible + cibocr_invisible + others_invisible) any – all text (any_visible + any_invisible) Notes: The property only affects output to text and metafiles. It is only valid for OutputFormat FormatText, FormatWebview, FormatJavaView,
FormatView. Examples: TextSelectionFilter={“groups“:[“cibocr_invisible“]} TextSelectionFilter={”groups”:[”any_visible”, “any_invisible”]} |
Set |
UseColorProfileForCMYK (since CIB pdf toolbox Version 1.4.98) |
String |
Possible values for conversion to RGB: "1" "US Web coated" and "sRGB" profiles are used (default). "0" simple variant. |
Set |
UseJbig2Compression (ab CIB pdf toolbox Version 1.10.0) |
String |
Attention: For graphic overlay only. This property can be used to deactivate the Jbig2 compression, which is activated by default for overlay graphics. 0 Jbig2 compression is disabled, standard ZLIB compression is applied. 1 Jbig2 compression is activated (default). Note: |
Set |
UseWinGDI |
String |
No longer in use, replaced by RenderingEngine=WinGDI „1“ = Windows rendering engine is used (default for Windows systems) „0“ = Internal rendering engine is used (default for Unix systems) |
Set |
UseSvgExternalImages (since CIB pdf toolbox Version 1.17.0) |
|
Allows all internal images that are combined to SVG graphics to be stored separately from the SVG content as external resources (JPEG or PNG). Possible values: 0 deactivated 1 activated |
|
ViewCallback |
String |
Adresse des Callbacks für Rückmeldung nach jeder Seite (interne Prop.) |
Get/ |
WorkSpace
(since CIB pdf toolbox Version 1.4.81):
(since CIB pdf toolbox Version 1.4.84): |
String |
Defines the working directory for all file name specifications, except output files. The path is specified as a zero-terminated character string. The path can be absolute or relative to the working directory of the calling process. All file specifications (without absolute path) in properties are considered relative to this workspace. A list of work¬directories can also be specified. The individual specifications are separated by semi-colons. For each file used, a search is started and the first location is used. From this version on, the WorkSpace property no longer applies to output files. |
Get/ |
PageXmpMetadata (since CIB pdf toolbox Version 1.14.0): |
String |
This property is used to add or overwrite page-related metadata in a PDF. They are referenced on the respective page via "/Metadata". Syntax: Metadata (UTF-8 encoded) can be specified for each page or page range of the output PDF. The metadata can be transferred as an XML file or memory block. If a page already contains metadata, it is replaced by the new data. If only some pages of a document are addressed, metadata of the remaining pages remains unchanged. Examples: PageXmpMetadata= PageXmpMetadata= PageXmpMetadata= |
Set |
XMPMetadataExtension |
String |
Allows the specification of one or more XMP snippets of type rdf:Description. These will be added to the metainfo of the resulting PDF during the conversion process (CibPdfSave()). Please note the official XMP specification from Adobe. |
Set |
XfdfIgnorePageRotation (since CIB pdf toolbox Version 1.17.0): |
String |
0 (default): Coordinates are interpreted in the page coordinate system and depend on page orientation and cropping. (0,0) is the origin of the MediaBox of the page. 1: Coordinates are interpreted relative to the visible side. (0,0) is the coordinate bottom left on the visible side (crop and rotate)
|
Set |
XfdfFlipPositionY (since CIB pdf toolbox Version 1.24.0): |
String |
This property is used to change the starting point / anchor of the coordinates from bottom left to top left. 0 (default): Starting point / anchor of the coordinates on the lower left. 1: Starting point / anchor of the coordinates top left. |
Set |
13.1. XMP Metadaten
GeneralExample
Example for XMP metadata
General
Extensible Metadata Platform (XMP) is a format for embedding RDF into binary data. It is intended to integrate metadata in all relevant Adobe Systems applications according to a uniform schema.
The content of the XmpMetadataExtension property is described by the following detailed requirements, which result in particular from the specifications in the XMP and PDF/A specifications:
- The attribute rdf:about must be set to "".
- The content of the description elements and the necessary specification of an own namespace are arbitrary within the XMP specifications.
- The string must be UTF-8 encoded.
- According to the XMP specification only name-value pairs (properties) can be stored in XMP.
- A value cannot itself be XML. However, structured values (signature area=Left,Top,Right,Bottom) and lists of values (Author=Thiel, Eisenschmid, Wissenbach) are supported by XMP. The available atomic data types are described in the XMP specification.
- For PDF/A conformance: If the specified namespace is not one of the "XMP schemas" predefined in the XMP specification, then the description of the associated schema must also be provided. See the information in the PDF/A specification regarding metadata. This is not required for normal PDF.
- The content of the „XmpMetadataExtension” is not checked for conformity.
- - The caller makes sure that the property value is an XMP compliant string in UTF-8 encoding. The prefixing of the XMP header and the XMP termination is not allowed.
- In the CIB documentServer this property must be encoded as CDATA section or with corresponding entities, and of course it must contain UTF-8.
Example
XmpMetadataExtension=”
<rdf:Description rdf:about=\”\” xmlns:xmpTGp=\”http://ns.adobe.com/xap/1.0/t/pg/\”>
<xmpTGp:NPages>25<xmpTGp:NPages>
</rdf:Description>
“
Example for XMP metadata
The green section describes the part that is the schema for the red individual content (=own property):
<rdf:Description rdf:about=”” xmlns:pdfaProperty=”http://www.aim.org/pdfa/ns/property/”>
<pdfaProperty:name>BackgroundFilename</pdfaProperty:name>
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
<pdfaProperty:category>internal</pdfaProperty:category>
</rdf:Description>
<rdf:Description rdf:about=”” xmlns:pdfaSchema=”http://www.aim.org/pdfa/ns/schema/”>
<pdfaSchema:namespaceURI>
http://www.cib.de/schemas/xmp/pdfprops/1.0/
</pdfaSchema:namespaceURI>
<pdfaSchema:prefix>cibpdf</pdfaSchema:prefix>
<pdfaSchema:property>
<rdf:Seq>
<rdf:li>BackgroundFilename</rdf:li>
</rdf:Seq>
</pdfaSchema:property>
</rdf:Description>
<rdf:Description rdf:about=”” xmlns:cibpdf=”http://www.cib.de/schemas/xmp/pdfprops/1.0/”>
<cibpdf:DefaultBackgroundFilename>wert1</cibpdf:DefaultBackgroundFilename>
</rdf:Description>
14. Internal modules in detail
The CIB pdf toolbox is divided functionally into individual modules to provide the user with the maximum benefit for his particular application. Each special output form has specific properties, which are supported by additional properties for these respective output types.
14.1. CIB pdf/print
GeneralSpecial options for print output
Printing via CUPS
Practical examples of direct printing requirements
General
CIB pdf/print is used as PDF print interpreter. It is designed to render and print the complete text content of the PDF file to a specified printer. The result should look as close as possible to the comparable standard tool (Acrobat Reader) of the format manufacturer (Adobe). The PDF specification of version 1.8 (Acrobat Reader 8) is supported. The graphic API of the respective operating system is used. All printer drivers and font installations of the respective platform are supported.
Special options for print output
Property description |
Type |
Functionality |
Kind |
DocumentUsedFonts (since CIB pdf toolbox 1.6.115) |
String |
Output of the fonts used in a document {name;size;attributes}. Example: |
Get |
DocumentReplacedFonts (since CIB pdf toolbox 1.6.115) |
String |
Output of the font replacements made during document processing. If a font is not available on the system, the CIB pdf tollbox will replace it with a font installed as "similar" as possible. The font replacements performed are documented in this property in the form: <font-replacement> ::= <font-replacement> | <font-replacement> „;“<font-replacement> <font-replacement> ::= „{“ <old font> „;“<new font> „}“ <old font> ::= <fontname> <new font> ::= <fontname> <fontname> ::= <text> Each font replacement is output only once. Example: |
Get |
DocumentUsedOriginFonts (since CIB pdf toolbox 1.6.115) |
String |
Output of the original fonts used in a document {name;size;attributes}. Example: |
Get |
DuplexPrint2 |
Char* |
DuplexPrint2 extends the specification for duplex printing and is used instead of the DuplexPrint property. „DuplexDefault“: „DuplexPrintShort“: „DuplexPrintLong“: „SimplexPrint“:
|
Get/ |
PageSelection
(since CIB pdf toolbox 1.4.83): |
Char* |
Enter
the desired page selection here. The indication "1-3" corresponds to pages 1 to 3, by specifying "1;3" you get page 1 and 3 (semicolon as separator !) Specification
of copies::
|
Set/ |
PaperBin |
Char* |
Targeted control of a specific printer tray. The following are possible: For example tray 1 Note: It is possible to use different trays for the first page and the rest of the document. The two trays are then separated by semicolons. Example: |
Set |
PaperBinReset |
Char* |
First page is printed on a different tray. Possible values: =„Bookmarks“ (Default) The first page of each copy, copy and partial document is printed on the first page tray. =“PartialDocuments“ =“Copies“ =“None“ |
Set |
ReceiverCopyMap (since CIB pdftoolbox 1.4.106)
(since CIB pdftoolbox 1.14.0) |
Char* |
In a table, meaningful names can be assigned to the bookmarks set in
the documents (copies). Syntax: <r-copy> ::= „{“ <NameNew> „;“ <bookmark> „;“ <NameNew> ::= <empty> | <empty> <Bookmark> ::= <text> <PapertypePage1> ::= <empty> | <text> <PapiertypeRest> ::= <empty> | <text> Example: Special case: One of the two shafts is missing: ReceiverCopyMap= {client;COPY1;letterhead} or {client;COPY1;;letterhead} Have the same result: But: ReceiverCopyMap= {client;COPY1;} generate an error - 304. |
Set |
PaperTypeMap (since CIB pdftoolbox 1.4.106) |
Char* |
In a table, the printer trays in which this paper is stored can be assigned to the paper types used. Tray names or tray numbers are printer-specific. Syntax: <Entry> ::= <Papertype> „,“ <Tray> <Papertype> ::= <Text> <Tray> ::= <Text> | <Number> Example: |
Set |
PaperTypes (since CIB pdftoolbox 1.4.106) |
Char* |
Default paper types can be set for the printout if no ReceiverCopyMap
is available. A maximum of two paper types are possible (for the entire
document or for the 1st page and the rest). The set paper types are applied either per copy (according to PageSelection) or to the entire document. Syntax: <Papertype> ::= <Text> Example: PaperTypes=Letterhead;Letter
|
Set |
PrintBracketMode (ab CIB pdftoolbox 1.4.106) |
Char* |
Several print documents can be stapled in one print job. This prevents print pages from different people from being mixed and then having to be sorted apart by hand. These documents can be RTFs or PDFs (also mixed). Possible values: Open PrintBracket is empty: Close PrintBracket is empty: Cancel PrintBracket is empty: |
Set |
PrintBracket (since CIB pdftoolbox 1.4.106) |
Long |
When starting a new bracket (PrintBracketMode=Open) the CIB pdf toolbox (or the CIB format) creates a new bracket handle. This handle is stored in the PrintBracket property. This handle points to the print order instance where management information (printed pages, printed documents, etc.) is stored and additionally stored in Windows: the spooler handle Linux: a list of file paths |
Set/ |
PrintMode (since CIB pdftoolbox 1.13.0) |
Char* |
Works only under Windows With RenderingEngine=CIBRenderer the CIBRenderer is used for the rendering process of the print (OutputFormat=FormatPrinter) and creates temporary files as an intermediate step which are then passed to the printer. Possible values: Auto (or empty): Postscript is used if the printer driver is postscript capable, otherwise GDI. Postscript: Postscript is used if the printer driver is postscript capable.(Otherwise error 304). GDI: Print with GDI. PCL: Is not supported yet (error 304). The properties PrintBrackets, PageSelection, PrintCopies2, DuplexPrint2, SortedPrint2, PaperBins, InsertEmptyPageBetweenBookmarks, and PaperBinReset can be used. If RenderingEngine is different from CIBRenderer only GDI is supported. That means if PrintMode is empty or Auto or GDI, GDI is used. Otherwise there is error 304. |
Set |
ParentHwnd2 |
Char* |
The window handle is passed to the application with respect to which the print dialog is to be centered. (default: window handle of the desktop) |
Set |
PrintCopies2 |
Char* |
The number of copies of the original that will be printed. Specify the number of additional copies, default is 0. |
Set/ |
SortedPrint2 (ab CIB pdf toolbox 1.6.117) |
Char* |
Output sorted or unsorted copies to the printer. This property is only useful if PrintCopies2 > 0. This property is supported for both simplex printing and duplex printing. Possible values: „1“: The pages of the Pdf document are printed sorted (default). „0“: The pages of the Pdf document are printed unsorted. In this case the property RequestedPages is not supported. In addition: Example: for PageSelection="3;6;8", PrintCopies2=1 and Duplex-Print, the output for SortedPrint2=1 is: "3,6,8,blank,3,6,8,blank". For SortedPrint2=0 is output: "3,6,3,6,8,blank,8,blank". The whole in simplex print results in "3,6,8,3,6,8" (for SortedPrint2=1) and "3,3,6,6,8,8" (SortedPrint2=0). |
Set |
PrinterChanged2 |
Char* |
„1“: Printer has been changed. „0“: The printer has not been changed. |
Get |
PrinterLocalisation |
Char* |
Definition of the printer types to be fetched with PrinterAvailable. „PrinterDefault“: „PrinterLocal“: „PrinterNetwork“: „PrinterCUPS“: |
Set |
PrintedPageCount2 |
Char* |
Returns the number of pages printed. |
Get |
PrinterName |
Char* |
Windows: |
Set |
PrintToFile2 |
Char* |
„0“: the printout goes to the desired printer. „1“: the print is redirected to a file. This file is either determined in the user dialog or can be set in advance using the OutputFilename property. |
Set |
PrintDialogDisableToFile2 |
Char* |
„1“: The checkbox "Redirect output to file" is not displayed in the print dialog. „0“: The checkbox is displayed (default).
|
Set |
PrintDialogDisableSelection2 |
Char* |
„1“: The options for selecting individual pages in the print dialog are grayed out and cannot be used. „0“: The options for selecting individual pages are available (default). |
Set |
PrintDlgHwnd2 |
Char* |
Window handle of the used print dialog. |
Get |
PrinterPortName |
Char* |
Print on this port (Get only). |
Get |
DefaultPrinter |
Char* |
Return of the default printer. |
Get |
PaperBinAvailable |
Char* |
Return the available printer bays of the printer from Property PrinterName or the default printer if PrinterName is empty. |
Get |
DeviceCapability.DuplexAvailable |
Char* |
Returns whether the printer from Property PrinterName (or the default printer if PrinterName is blank) is capable of duplex or two-sided printing. Possible values: |
Get |
PrintCommentList (since CIB pdf toolbox 1.9.2) |
Char* |
Specifies whether the visible comments should be listed when printing (corresponds to "Summarize comments" in Adobe Professional). Possible values: „0“: No comment list is printed. (default) „1“: All visible comments in the PDF document receive a consecutive number and are listed in additional pages. |
Set |
PrintCommentListTypes (since CIB pdf toolbox 1.9.2) |
Char* |
The property specifies which special comment types should be listed. It is only effective if PrintCommentList="1".
Possible values: „“: (empty string - default) All visible comments are listed. Non-empty-string: A semicolon-separated list of comment types to be listed. For example, "Circle;Freetext;Text". |
Set |
PrintCommentListEmpty (since CIB pdf toolbox 1.9.2) |
Char* |
Specifies whether only the comments with non-empty text are listed. Possible values: „1“: All matching comments are listed, whether they contain text or not. (Default) „0“: Only those comments are listed that really contain text. |
Set |
Printing via CUPS
The CIB pdf toolbox supports under Linux the print control via CUPS (Common Unix Printing System).
CUPS consists of a client-server architecture, i.e. the program is divided into a print client, which sends the print jobs, and a print server, which does the printing on the computer to which the printer is connected.
The standard format for CUPS is Postscript (PS), therefore the CIB modules under Linux always generate PS which is passed to the CUPS interface. Usually CUPS will pass the PS to the connected printer. However, depending on the configuration and the printer's capabilities, CUPS may also perform a conversion (e.g. to PCL).
Requirements for the control of a CUPS print under Linux:
- Existence of a CUPS version greater than 1.2
- Installation of PDFTOPS 3.0 from poppler-utils package 0.5.4
- gtk 2.10 (fort he PrintDialog)
Practical examples of direct printing requirements
Direct
printing can be done via the CIB Runshell or the direct dll functionality.
Simple runshell call for printing a PDF file:
cibrsh.exe –fp Test.pdf
To print via the Dll, the following steps are required as a basis:
Using the method SetProperty(), assign the value "InputFilename" to the document to be printed.
Using the method SetProperty(), set the value "OutputFormat" to "FormatPrinter.
Execute the CibPdfJoin() method.
These calls print the specified input file to the default printer. You can make more detailed print specifications using further properties.
The following are examples of common duplex printing applications.A printer with duplex capability is required. In the examples, the printer has a manual ("BinManual") and an upper tray ("BinUpper").
Printing simple document
A simple
document is printed in which there are no bookmarks.
Usecase |
Properties |
Result |
Complete printing of the document |
None required |
The complete document is printed out once. |
Complete print with copies |
PrintCopies2=1 |
The complete document is printed out twice. |
Printing parts of the document |
PageSelection=1-3;7 InsertEmptyPageBetweenRtfBookmarks=“1“ |
Only pages 1, 2, 3 and 7 are printed. Setting the property "InsertEmptyPageBetweenRtf-Bookmarks" prevents page 7 from being printed on the back of page 3. |
Printing parts of the document with copies |
PageSelection=1,1;5,2 InsertEmptyPageBetweenRtfBookmarks=“1“ |
Only page 1 is printed twice and page 5 three times. |
Print on different trays |
PaperBin=“BinManual;BinUpper“ |
The first page of the document is printed on the manual tray and the rest on the top tray. |
Printing with copies and different trays Option 1 |
PrintCopies2=1 PaperBin=“BinManual;BinUpper“ PaperBinReset=Bookmarks |
The first page of each copy of the form is printed on manual tray, the rest on top tray. |
Option 2
|
PrintCopies2=1 PaperBin=“BinManual;BinUpper“ PaperBinReset=None |
The first page of the print job is printed on the manual tray, the rest on the top tray. |
Printing a document with copies
The document contains the bookmarks COPY1, COPY2 and COPY3. Each of these bookmarks stands for a text area in the document. For example, under the identifier COPY1, a certain part of the document (= copy 1) can be directly addressed and printed.
The InsertEmptyPageBetweenRtfBookmarks="1" property must be set so that when printing and odd number of pages each copy starts on a new sheet.
Usecase |
Properties |
Result |
Complete printing of the document |
No further properties required |
The complete document is printed out once. Blank pages are inserted so that each copy starts on a new sheet. |
Printing parts of the document |
PageSelection=COPY2 |
Only COPY2 is printed. |
Printing parts of the document with and without copies |
PageSelection=COPY1,1;COPY3 |
Copy 1 shall be printed twice and copy 3 once. |
Printing on different trays Option 1 |
PaperBin=“BinManual;BinUpper“ PaperBinReset=Bookmarks |
The first page of each copy contained in the document is printed on manual tray, the rest on top tray. |
Option 2 |
PaperBin=“BinManual;BinUpper“ PaperBinReset=None |
The first page of the document is printed on manual tray, the rest on top tray |
Printing to different trays with copies |
PrintCopies2=1 PaperBin=“BinManual;BinUpper“ PaperBinReset=Copies |
The complete document is printed twice. The first page of each copy goes to the manual tray and the remaining pages to the top tray. |
Printing of form bundles (concatenation of simple documents)
Concatenation: CIB pdf/join is used to concatenate simple PDF documents (i.e. they do not contain bookmarks) into a single large PDF document. One also speaks of a form bundle.
By setting the property JoinHistory="1", a marker is set at the transitions between the individual documents so that duplex printing on a new sheet starts at this point.
Printing: Setting the property InsertEmptyPageInDuplex="1" causes empty pages to be inserted between the individual documents (see JoinHistory) so that each document part starts on a new sheet.
Usecase |
Properties |
Result |
Complete printing of the form bundle |
No further properties required |
The complete form bundle is printed out once. Blank pages are inserted so that each individual document begins on a new sheet. |
Printing individual pages of the form bundle without and with copies |
PageSelection=1;10,2 InsertEmptyPageBetweenRtfBookmarks=“1“ |
Page 1 of the form bundle is printed once and page 10 three times. Setting the "InsertEmptyPageBetweenRtf-Bookmarks" property prevents page 10 from being printed on the back of page 1. |
Printing on different trays Option 1 |
PaperBin=“BinManual;BinUpper“ PaperBinReset=Bookmarks |
The first page of each partial document is printed on manual tray, the rest on top tray. |
Option 2 |
PaperBin=“BinManual;BinUpper“ PaperBinReset=None |
The first page of the form bundle is printed on manual tray, the rest on top tray. |
Printing to different trays with copies |
PrintCopies2=1 PaperBin=“BinManual;BinUpper“ PaperBinReset=Copies |
The complete form bundle is printed twice. The first page of each copy goes to the manual tray and the remaining pages to the top tray. |
Printing of form bundles with copies
The individual documents contain the bookmarks COPY1, COPY2 and COPY3. These bookmarks mark text areas for printouts in the individual documents. The name of a particular bookmark can also appear in several individual documents. In this case, all text areas named in this way are selected when this copy is printed.
Concatenation: With the CIB pdf/join the individual PDF
documents are concatenated to form a single large PDF document (= form bundle).
By setting the property JoinHistory="1",
a marker is set at the transitions between the individual documents so that
duplex printing on a new sheet starts at this point.
Printing: Setting the property InsertEmptyPageInDuplex="1" causes empty pages to be
inserted between the individual documents (see JoinHistory) so that each
document part starts on a new sheet.
By setting the InsertEmptyPageBetweenRtfBookmarks="1"
property, each copy also starts on a new sheet.
Usecase |
Properties |
Result |
Complete printing of the form bundle |
No further properties required |
The complete form bundle is printed out once. Blank pages are inserted so that each document part and each copy starts on a new sheet. |
Printing parts of the form bundle without and with copies |
PageSelection=COPY1;COPY2,1 |
All copies1 from the form bundle are printed once and the copies2 twice. |
Printing on different trays Option 1 |
PaperBin=“BinManual;BinUpper“ PaperBinReset=Bookmarks |
The first page of each part document and each copy is printed on manual tray, the rest on top tray. |
Option 2 |
PaperBin=“BinManual;BinUpper“ PaperBinReset=PartialDocument |
The first page of each partial document is printed on manual tray, the rest on top tray. |
14.2. CIB pdf/join/split
This
section gives an introduction to the functionality of the PdfJoin of the CIB
pdf toolbox since version 1.3.60.
With the InputFilename property, in addition to joining entire PDF documents
(as before), it is also possible to join specific pages of one or more PDF
documents in combination with empty pages.
Examples for page selection
Special properties for changing document properties
Special properties for the generation of graphics
Special properties for the ZUGFeRD data model
Blackening functionality
Special options for PDF join
Name |
Value |
Effect |
||
InputFilename |
=“[{PageNumbe(s);]FileName[;[{PageNumber(s)};]FileName; | EMPTY[:width,height];]...“
Values in square brackets are optional. |
A result document is compiled from the documents, page specifications etc. specified in InputFilename. At least one PDF document with or without page specification(s) must be specified. In addition to this, further PDF documents with or without page specification(s) as well as empty pages with or without page size can follow. The page details must be given in curly brackets. |
||
PageNumber(s) |
Not specified or "All" |
Select all pages |
||
“Odd” |
Select odd pages |
|||
“Even” |
Select even pages |
|||
“First” |
Select first page only |
|||
“Last” |
Select last page only |
|||
“NoFirst” |
Select all pages except the first |
|||
“NoLast” |
Select all pages except the last one |
|||
Number |
Select page number only |
|||
Number1-Number2 |
From page select Number1 to Number2, where Number1<Number2 |
|||
Number1-Number2,Number3...,NumberN-NumberM |
Select multiple pages or page ranges (comma as separator) |
|||
FileName |
Path to file |
The pages of this file are selected |
||
EMPTY |
“EMPTY” |
Insert a blank page with width and height of the last inserted page |
||
Width |
Number (integer, x, or decimal, x.y, allowed) |
Set width of blank page in mm |
||
Height |
Number (integer, x, or decimal, x.y, allowed) |
Set the height of the blank page in mm |
||
PageRotation |
page number(s);angle[;page number(s);angle][;...] |
Individual pages can be rotated. Several pages can be specified at different angles. For the priorities see below. |
||
Page number(s) |
See InputFilename. |
The page numbers refer to the result document (after join/split). |
||
Angle |
Possible are: |
Degrees for rotation The rotation is clockwise in multiples of 90°. Example: PageRotation={All};90;{3};180 |
||
PageSelection |
The possible values are described in the chapter CIB pdf/print. Note: |
The PageSelection property is evaluated for the following output formats: OutputFormat= FormatPrinter |
||
PdfVersion (since Version 1.6.116b) |
Possible values: PDF/A-1b PDF/A-2b PDF/A-3b |
Set-Property One or more PDFs can be converted to the PDF version specified here. The property "OutputFormat=FormatPdf" or "OutputFormat=FormatSearchablePdf" must be set. |
||
SplitPages |
=0 (default)
=1 |
Result is an output document The result document is split into one-page output documents. The output documents are identified by appending a sequential number.
cibrsh SplitPages=1 -fj Dok1.pdf;Dok2.pdf output.pdf results in: |
||
EmbeddedFiles (since Version 1.8.0) |
<EmbeddedFiles> ::= <EmbedFilename> | <EmbedFilename>;<EmbedFilename> <EmbedFilename> ::= „{“<PageReference>;<EmbedFilename-withoutpage>“}“|“{“<EmbedFilename-withoutpage>“}“ <EmbedFilename-withoutpage> ::= <Relationship>;<EmbedFilename-simple>|<Description>;<EmbedFilename-simple>|<Relationship>;<Description>;<EmbedFilename-simple>|<EmbedFilename-simple> <Relationship> ::= “RELATIONSHIP=”<name> <Description> ::= “DESC=”<name> <EmbedFilename-simple> ::= Filename |
Set-Property This property can be used to specify a list of files to be attached to the PDF or to individual pages of the PDF during PDF generation. The file(s) are entered in the relevant catalog/page dictionary. Example: EmbeddedFiles={1-3;Relationship=Source;Desc=”Description”;file1.pdf};{Relationship=Source;Desc=”Description for another file”;file2.pdf}; To consider: - “Description” is only evaluated for PDF versions >= 1.6. Any text can be entered. -
“Relationship” is only evaluated for PDF/A3
conversion (PDF/A-3a, PDF/A-3b, PDF/A-3u). - If one or more page numbers are specified for an embed file name, the file is added as an attachment to that page(s). Otherwise it is an attachment of the complete PDF document. - The page number can be: Page number(s), range or a combination of both, separated by commas. Example: "1.5-6.10";; In "EmbedFilename" the following characters can be used for masking: "\;" for ";" "\\" for "\." |
||
DeleteEmbeddedFiles (since Version 1.8.0) |
<DeleteEmbeddedFiles> ::=
All |. |
Set-Property This property can be used to specify a list of files to be removed
from the PDF attachment. The corresponding entries are deleted from the relevant
catalog/page dictionary. Example: DeleteEmbeddedFiles={test.pdf};{22} DeleteEmbeddedFiles=test.pdf;13 Notes: - „All“: All attachments are deleted. The file to be deleted can be specified by its name or a number. -
Name: -
Number: |
||
UpdateEmbeddedFiles (since Version 1.8.0) |
Syntax is identical as |
Set-Property This property can be used to change the description of the attached files. Note: - The file to be modified can be specified by its name or a number or both. see „DeleteEmbeddedFiles“ Example: UpdateEmbeddedFiles={Desc=Desc;Relationship=Source;file.pdf;2};{Desc=Desc;Relationship=Source;file2.pdf} |
||
ExtractEmbeddedFiles (since Version 1.8.0) |
Syntax is identical as |
Set-Property This property can be used to extract an attached file from the PDF. The output is sent to the file specified in the property "OutputFilename". |
||
EmbeddedFilesInfo (since Version 1.17.0) |
The content has the following structure: [{"Relationship": "File type", "ID":IdNr, "Filename": "Filename", "Size":Size, "CompressedSize":CompressedSize} ] File type=None | Source | CibEpdfSource | HybridPdfSource | any default value for an AFRelationship key IdNr=Sequential number of embedded files(For LibreOffice hybrid PDFs the number is negative) |
Get-Property It is a Get-Property, which returns information about files embedded in the PDF in JSON format. Required
is: OutputFormat=FormatInfo
Examples: Embedded Cib Epdf source file: [ {”Relationship”:”CibEpdfSource”,”ID”:1,”Filename”:”Utf8FilenameWithoutBom.pdf”,”Size”:1024,”CompressedSize”:512} ] 2 Embedded Cib Standard source files: [ {”Relationship”:”Source”,”ID”:1,”Filename”:”FirstUtf8FilenameWithoutBom.anyext”,”Size”:1024,”CompressedSize”:512},{”Relationship”:”Source”,”ID”=2;”Filename”:”SecondUtf8FilenameWithoutBom2.anyext”,”Size”:2048,”CompressedSize”:1024} ] Embedded content of LibreOffice HybridPdfs: [ {”Relationship”:”HybridPdfSource”,”ID”:-1, “Filename”:”TheSameAsPdfDocName.odt”,”Size”:1024,”CompressedSize”:512} ] |
||
EmbeddedFilesInfoFilter (since Version 1.17.0) |
EmbeddedFiles Epdf or both |
Set-Property This property can be used to restrict the type of the embedded file. Required is: |
||
FilterInfo (since Version 1.8.0)
|
RtfBookmarks
|
Get-Property Information about the document properties and bookmarks contained in the PDF is written to an XML file. Required is:
The document properties are written to the XML file All (RTF) bookmarks contained in the PDF are written to the XML file. Structure of the XML file: <pdfdocument> |
||
(since Version 1.17.0) |
EmbeddedFilesInfo |
Information about the files embedded in the PDF is returned in the EmbeddedFilesInfo property. |
||
(since Version 1.20.0) |
FontsInfo ImagesInfo |
Information about the fonts and images contained in the PDF document is returned in the properties FontsInfo and ImagesInfo. |
||
Region (since Version 1.4.86) |
=[[<page>:]<x1_mm>;<y1_mm>;<x2_mm>;<y2_mm>]...
Values in square brackets are optional |
With Region you specify one or more rectangles, and the sides on which the rectangles are located. The union of all these rectangles (intersected with the side face) indicates the area from which the text is extracted, i.e. all characters that are not at least partially within one of these rectangles are ignored as if they were not present. If OutputFormat=FormatText is specified, the extracted text is written to outputfile.txt, formatted as unicode and with line breaks |
||
<page>: |
Not specified or “All“ |
Description see above |
||
<x1_mm>;<y1_mm> …… |
Numbers, separated by semicolon. The unit is mm. |
2 pairs of values are required to describe a rectangle. Each pair describes the coordinates of a corner point of the rectangle. The reference point for the coordinates is the upper left corner of the page.
Example: cibrsh OutputFormat=FormatText Region=NoLast:10;20;80;40;1:85;120;190;145 -fj Test.pdf output.txt |
||
PageCropping (since Version 1.25.0) |
JSON Syntax PageCropping= [<*PageBoxInfo*>, <*PageBoxInfo*>] PageBoxInfo = {”PageNumber”:<PageNum>, “ClipBox”:[<X0>, <Y0>, <Width>, <Height>]} PageNumber = Page number of PDF ClipBox is an area with the parameters : X0(left), Y0(bottom), width, height unit: pt The X0 and Y0 values are relative to the upper left corner of a visible page (or image). |
This property can be used to set a rectangle that defines a mask frame. This frame crops the PDF document for display in the PDF viewer or for printing. Cropping only hides the information outside the mask frame and does not delete it, i.e. if the frame is subsequently modified, the hidden information is visible again. Die Property-Einträge beziehen sich immer auf eine Seite des PDF-Dokuments. Example: Cropping the first and third page of the PDF document: PageCropping=[{’PageNumber’:1, ‘ClipBox’:[10,20,300,400]}, {’PageNumber’:3, ‘ClipBox’:[20,20,100,200]}] |
||
TableMode (since Version 1.4.100) |
=0 (default)
=1 |
Extracted text is output continuously.
Extracted text is output as a table. |
||
TextFormattingOptions (since Version 1.20.0)
(since Version 1.25.0) |
={
“SeparateTextBlocks”: } |
With EnableTextFormatting=true (default=false) a special word processing module is activated with additional functions to improve the text quality as:
· - Eliminate hyphens from word division · - Dissolving ligatures · - Convert initials to normal text
Only for OutputFormat=FormatText Example: cibrsh.exe OutputFormat=FormatText TextFormattingOptions={”EnableTextFormatting”:true,”OutputFormats”:[”hocr”]} -fj input.pdf out.txt
SeparateTextBlocks=true (default=false) searches for text blocks, which are then separated by an empty line in the text output. This improves the readability of the output text. Text blocks are identified by the fact that they have a larger distance between them. |
||
API (since Version 1.20.0) |
=1
=2 |
Default: The CIB pdf toolbox executes the job.
The CIB pdf toolbox becomes a wrapper for the new CIB pdf modules. This means that the CIB pdf toolbox does not execute the task itself, but the library of the CIB pdfModule is loaded and this library takes over the execution. For details see chapter "CIB pdfModule" |
The page specifications have different priorities, so that lower priorities can be overwritten by higher ones. The priorities are distributed as follows:
No priority: All, Odd, Even, NoLast, NoFirst
priority RANGE: Number1 – Number2
priority DIRECT: Last, First, Number
The following order of priority applies: No priority < RANGE < DIRECT
If two specifications have the same priority, both apply, otherwise the one with the higher priority applies.
Examples for page selection
The following examples show possible assignments of the InputFilename property.
1) InputFilename=Document1.pdf;{4,7-9};Document2.pdf;Document3.pdf
Here all pages of document1.pdf,
pages four, seven, eight and nine of document2.pdf and all pages of document3.pdf
are joined together in exactly this order.
2) InputFilename={5,4,3,2};Document1.pdf;{All};Document2.pdf;Document3.pdf;{Even};Document4..pdf
Here the pages five, four, three and two of document1.pdf, all pages of document2.pdf, all pages of document3.pdf and all even pages of document4.pdf are joined in exactly this order.
3) InputFilename={First,Last};Document1.pdf;EMPTY;EMPTY:210,297;{7,10};Document2.pdf
Here the first and last page of Document1.pdf, a blank page with the width and height of the last page of Document1.pdf, a blank page with a width of 210 mm and height of 297 mm and pages seven and ten of Document2.pdf are joined in exactly this order.
4) InputFilename={};Document1.pdf;{Odd};Document2.pdf;EMPTY:210,297
Here all pages of document1.pdf, all odd pages of document2.pdf and an empty page with a width of 210 mm and a height of 297 mm are joined in exactly this order.
5) InputFilename={NoFirst};Document1.pdf;EMPTY:210,297;{8,6,5,2-4};Document2.pdf;EMPTY
Here all pages except the first of Document1.pdf, a blank page 210 mm wide and 297 mm high, pages eight, six, five, two, three and four of Document2.pdf and a blank page the width and height of the fourth page of Document2.pdf are joined in exactly this order.
Special properties for changing document properties
(from CIB pdf toolbox 1.4.84) Only in PDF Join.
Property |
Type |
Functionality |
Kind |
DocInfo.Author |
String |
Enters the author. Overwrites the information stored in the PDF. |
Get/ |
DocInfo.Title |
String |
Enters the title. Overwrites the information stored in the PDF. |
Get/ |
DocInfo.Subject |
String |
Enters the subject. Overwrites the information stored in the PDF. |
Get/ |
DocInfo.Keywords |
String |
Enters the keywords. Overwrites the information stored in the PDF. Maximum length is 64K. |
Get/ |
DocInfo.CreationDate |
String |
Enters the creation date Format: JJJJMMTThhmmss+01‘00‘ |
Get/ |
DocInfo.ModDate |
String |
Enters the date of change Format: JJJJMMTThhmmss+01‘00‘ |
Get/ |
ModuleName |
String |
Enters the program with which the PDF was created. |
Get/ |
CallerApplicationname |
String |
Application that changed the PDF. |
Get/ |
Special properties for the generation of graphics
(from CIB pdf toolbox Version 1.4.102)
With the module CIB pdf join it is possible to create graphic files in addition to PDF output.
Property |
Functionality |
Type |
|
OutputFormat |
Format of the output file The following graphic formats are supported: FormatTiff FormatBmp
FormatWebview |
String |
|
OutputFormat (since Version 1.5.113) |
FormatExtractImages If this output format is specified, all Image-XObjects contained in the input PDFs are exported. The output is in TIFF format or in JPEG format under the file name specified in OutputFilename. Note: - No PDF is written - OutputFilename is a required field - Output to memory is not possible - No dpi value is written to the TIFF image file(s) A.) For the TIFF images there are two cases to distinguish: 1.)
TiffSinglePage=“0“ (default): 2.)
TiffSinglePage=“1“: „Output“ is the value of OutputFilename, but without extension „000pp“ is the number of the page on which the image object first appears. „000oo“ is the number of the image object.
TIFF
images can be generated directly or the Pdf image objects are first converted
into the DIB format (Windows Bitmap) and from there into the TIFF format. - The Pdf image object has none of the filters JBIG2Decode, DCTDecode or JPXDecode. - It has no mask and is not a mask. - The color space is "DeviceGray", "DeviceRGB" or "DeviceCMYK" (with BitsPerComponent 8). - The entry "Decode" is missing or is the default entry for the respective color space ([0 1] for "DeviceGray", [0 1 0 1 0 1] for "DeviceRGB", [0 1 0 1 0 1 0 1] for "DeviceCMYK").
For all other Pdf image objects the TIFF output is done via the intermediate step as DIB format. In this case, not all image properties are retained. Remained also with the DIB intermediate step: Number of pixels in width and height of the image object. The following can be changed at the DIB
intermediate step:
- It has no mask and is not a mask. - The
color space is "DeviceRGB“. The JPEG file name is formed according to the same rule as the file name for the individual TIFF files (see above). |
String |
|
ExtractImagesCallback (since Version 1.17.0) |
Address of the callback function called by the CIB pdf toolbox when parsing the PDF document each time an image object is extracted.
|
String |
|
ExtractImagesUserdata (since Version 1.17.0) |
Address of the memory area where the extracted image data and its hash value is passed. |
String |
|
OutputFormat (since Version 1.14.0) |
FormatImage With this output format, the CIB pdf toolbox generates several output graphic formats during one rendering process. These must be raster graphics formats. Required: RenderingEngine="CIBRenderer" The "ImageType" property defines which graphic formats are to be created. |
String |
|
OutputFormat (since Version 1.14.0) |
FormatSvg The CIB pdf toolbox outputs a graphic file in SVG format (Scalable Vector Graphics). This is the specification recommended by the World Wide Web Consortium (W3C) for the description of two-dimensional vector graphics, which is based on XML. Name of the generated output: Required: RenderingEngine=“CIBRenderer“ |
String |
|
OutputFilename |
Name of the output file, with the appropriate extension. PNG and JPEG: One file is output per page in the PDF. The name is made unique by appending a consecutive number. |
String |
|
InputFilename |
Name of the input PDF Several PDFs, separated by semicolon, can also be entered. |
String |
|
AbortDocCallback (since Version 1.10.0) |
Address of the callback function for output document by memory transfer. Interface description see chapter "AbortDocCallback” |
String |
|
AbortDocCallbackPointer (since Version 1.10.0) |
Benutzerdaten des Callbacks für Rückmeldung nach jeder Seite |
String |
|
EventNotifier (since Version 1.24.0) |
The pointer to the instance of the callback class CibPdfEventNotifier is assigned to this property. This enables the output of RGB565 data into memory. Required for this functionality is OutputFormat=FormatBmp and RenderingEngine=CIBRenderer |
String |
|
ImageAlign (since version 1.8.6c) |
The property can be used to improve the alignment of graphics in the PDF if the graphics are contiguous and not rotated. Condition: 0 Optimization is switched off 1 Optimization is switched on (default) |
String |
|
ImageScaling (since version 1.9.7)
(since version 1.14.0) |
The property can be used to specify the maximum size of the graphic. width;height in px, or resolution in dpi. Valid values: Note: Examples: ImageScaling=100px;200px ImageScaling=;200px ImageScaling=200px ImageScaling=100dpi oder ImageScaling=100 Extension for the use of the property "ImageType": When generating several graphic formats in one rendering process, graphic proportions can be specified here for each graphic format generated. The values are listed in the same order as the graphic formats were defined in the "ImageType" property. For better readability the value pairs can be grouped with curly brackets. It is possible to enter blank values ";;", then the default DPI setting takes effect. Examples: ImageType=“png;tiff;bmp“ ImageType=“jpg;bmp“ |
String |
|
ImageType (since version 1.14.0) |
This property can be used to specify which graphic formats the CIB pdf toolbox should generate in a rendering process. Currently only raster image formats are possible here. Required is OutputFormat= FormatImage and RenderingEngine="CIBRenderer". Possible values are: Example: Name of the generated graphic files: In order to achieve unique file names for the various output formats
of a graphic file, the CIB pdf toolbox creates the file name as follows: Example: OutputFormat=“FormatImage“ Results in the following files: Note: |
String |
|
Threads (since version 1.15.0) |
With this property, the conversion into several graphic formats and the subsequent writing of the files can be parallelized during the rendering process, which leads to a better performance. Required are the properties ImageType and RenderingEngine=“CIBRenderer“ Possible values: N A maximum of N threads are used to create the graphic files. 0 No use of threads (default, behaviour of previous versions) |
String |
|
TiffResolution |
Resolution of the graphic output. Default value: 150 DPI |
String |
|
TiffStripSize |
StripSize as multiple of 8kB. 0 for none, Default is 4, so 32kB strips |
String |
|
TiffJpegQuality |
Only with TIFF: Jpeg compression factor, default is 75% |
String |
|
TiffSinglePage |
Only with TIFF: One TIFF file can be generated per PDF page. 0 One TIFF file per PDF (default) 1 One TIFF file per PDF page |
String |
|
TiffColorDepth |
Options for the color depth Only with JPG and PNG: 2Colors 256Colors 256Grayscale TrueColor (24Bit, Default) Only with BMP: HighColor (Requires RenderingEngine=CIBRenderer) |
String |
|
WebviewOutputConfiguration (since CIB pdf toolbox Version 1.10.0)
(since CIB pdf toolbox Version 1.17.0)
|
This property can be used to configure the generated output for the CIB doxiView so that only one output format is used instead of Png and Metafile by default. Possible Values: „Image“: „Metafile“: „MetafileAsSingleFile“: „MetafileNoPageContent“: „MetafileNoOutlines“: the values „MetafileNoOutlines“, MetafileNoPageContent“ and „MetafileAsSingleFile“ may be used cumulatively. They are only valid if "WebviewOutputConfiguration" is set to create metafiles only. When creating images, the entire PDF document must always be processed.
Examples: Standardvalue = „Image;Metafile“ (Since CIB pdf toolbox 1.20): Additionally, the option "ImageSkipAnnotations" can be used to specify that certain types of annotations for CIB doXiview rendering are not rendered into the output images. The option "ImageSkipAnnotations" has no effect on the output to a metafile. Example: WebviewOutputConfiguration=“Image;ImageSkipAnnotations:[Redact,Line];Metafile“ The following values are possible for annotation types: “Text”, “Link”, “FreeText”, “Line”, “Square”, “Circle”, “Polygon”, “PolyLine”, “Highlight”, “Underline”, “Squiggly”, “StrikeOut”, “Stamp”, “Caret”, “Ink”, “Popup”, “FileAttachment”, “Sound”, “Movie”, “Widget”, “Screen”, “PrinterMark”, “TrapNet”, “Watermark”, “3D”, “Redact”.
“MetafileWithGlyph” :
|
String |
|
SkipFormfieldContent (since CIB pdf toolbox Version 1.16.0)
|
Enables you to hide the contents of form elements (text fields, checkboxes, list fields) during display. Possible Values: 0: Form contents are displayed 1: Form contents are not displayed To be used in conjunction with OutputFormat=FormatWebview |
|
|
Special properties for the ZUGFeRD data model
(since CIB pdf toolbox Version 1.9.0)
The „Forum elektronische Rechnung Deutschland“ (FeRD) (Forum electronic invoices Germany) is the national platform of ministries, associations and companies to promote electronic invoicing in Germany. ZUGFeRD is the abbreviation for "Zentraler User Guide des Forums elektronische Rechnung Deutschland“ („Central User Guide of the Forum for electronic invoices Germany”)
Every invoice based on the ZUGFeRD data model must be a complete, valid invoice (both the PDF and XML representation). The XML file is always embedded with the name "ZUGFeRD-invoice.xml.
When embedding, the input file must either be in the PDF/A3 standard or a conversion to this standard must be carried out for the CIB pdf toolbox join.
Property |
Functionality |
Type |
ZUGFeRDXml |
Specifies a ZUGFeRD-compatible XML file, which is then embedded in the PDF in a ZUGFeRD-compatible manner. If OutputFormat=FormatInfo is specified, the property ZUGFeRDXml is assigned the name of the Zugferd XML if one is already embedded in the input PDF. |
String |
ZUGFeRDSchema |
Specifies a schema file against which the ZUGFeRD XML file can be checked during import or extraction. Example: Invoice.xsd |
String |
ZUGFeRDDoCheck |
Specifies whether a schema check should be performed when extracting or importing a ZUGFeRD XML file Possible Values: If no scheme file is specified in property ZUGFeRDSchema, the scheme file contained in the ZUGFeRD XML file is used for the scheme check. If the scheme check fails, an error 355 is issued. |
String |
ZUGFeRDDescription |
A description of the ZUGFeRD XML file can be stored in this property. This description is included in the PDF when the XML file is embedded. Input: Any text |
String |
Using the property "ExtractEmbeddedFile=zugferd" the ZUGFeRD XML file can be extracted in a normal CIB pdf toolbox join.
Blackening functionality
With the help of the "blackening" functionality you can remove the specified areas. They are no longer included in the resulting PDF output.
Name |
Value |
Effect |
ApplyRedactAnnotations
|
= 0 (default)
= 1 Blackening is carried out |
If a property is set, the CIB pdf toolbox blacks out the areas specified in the annotations.
Redaction (blackening) occurs in the following steps: 1. XFDF file is created with the editorial annotations. 2. CIB pdf toolbox imports these annotations into the PDF document via "AnnotationsFilename=abc.xfdf". The result is then a PDF that contains the areas to be blackened.
Example for XFDF file <?xml version="1.0" encoding="utf-8"?> <xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"> <annots> <redact page="0" rect="66.0,474.0,152.0,393.0" interior-color="#000000"> </annots> </xfdf>
Note: -> The page numbers are zerobased specified. -> The desired coordinates can be set by specifying a rectangle rect="66.0,474.0,152.0,393.0" -> where PDF coordinates are used as the unit (1 cm corresponds to 28.333... PDF coordinates). The rectangle is given as x,y lower left corner and x,y upper right corner. The origin (coordinate 0,0) of the page is at the bottom left. |
14.3. CIB pdfmodule
GeneralExample of Jobsteps to control the CIB pdfModule
General
(Since CIB pdf toolbox Version 1.20.0, CIB pdfModule Version 1.3.0)
The CIB pdfModule is a new development of a PDF module which has a significantly improved runtime behavior (on average less than 2% of the runtime of CIB pdf toolbox) and a significantly reduced memory consumption compared to CIB pdf toolbox.
The size of the output files can be reduced considerably and also merging several 1000 PDF files is no problem.
In the future all major new features will be developed in this module.
The CIB pdfModule can be controlled via the interface of the CIB pdf toolbox, but the binaries of the CIB pdfModule are required. To use this module you have to use the properties in addition to API=2. These are described in the CIB pdfModule Technical Guide.
It is also possible to use CIB pdfModule independently without the control by the CIB pdf toolbox. This is also described in the CIB pdfModule Technical Guide.
Property |
Functionality |
Type |
API
|
This property can be used to control whether the library of the CIB pdfModule is loaded.
1 Default: The CIB pdf toolbox executes the job.
2 The CIB pdf toolbox
becomes a wrapper for the new CIB pdfModule. This means that the CIB pdf
toolbox does not execute the task itself, but the library of the CIB
pdfModule is loaded and takes over the execution. |
String |
Example of Jobsteps to control the CIB pdfModule
Join 2 PDF documents, output of a compressed PDF in PDF/A format
……..
<job expected-result-code=”0” id=”” name=”TestJob” timeout=”0”>
<properties>
<property name=”OutputMode”>XML</property>
</properties>
<outputs/>
<steps>
<step command=”pdfjoin” expected-result-code=”0” name=”join” timeout=”0”>
<properties>
<property name=”InputFilename”>input1.pdf;input2.pdf</property>
<property name=”LicenseCompany”>testlizenz</property>
<property name=”LicenseKey”>dddd-3333-9999aaaa</property>
<property name=”API”>2</property>
<property name=”WritingMode”>XrefStream</property>
<property name=”MergePdfAConform”>1</property>
<property name=”GenericFormfieldNamePrefix”>1</property>
<property name=”RegenerateFormFieldAppearences”>1</property>
<property name=”DetectDuplicateStreams”>1</property>
</properties>
</step>
<step command=”save” expected-result-code=”0” name=”save” timeout=”0”>
<properties>
<property name=”OutputFilename”>./out.pdf</property>
</properties>
</step>
</steps>
</job>
………
15. Stationary function, overly of texts, graphics and barcodes
This section gives an introduction to the stationery and overlay functionality of the CIB pdf toolbox. Using the stationery function it is possible to overlay PDF documents with other PDF documents. The overlay function allows to position various graphics and text anywhere in PDF documents.
15.1. Stationary function
General
Additional instructions
Examples
Remarks on pages in different formats
Examples with different formats
General
By specifying the "BackgroundFilename" property for the PdfJoin, the result document of the join is stored with the PDF files specified in this property. Various specifications are possible here to distribute the background document as required over the pages of the main document.
Via the property "BackgroundFilenameAsForeground" it can be arranged that the result document is not stored, but that the file specified here is placed in the foreground.
BackgroundFilenameAsForeground:
Possible Values:
0 Document lies in the background
(default)
1 Document lies in the foreground
The "BackgroundFilename" property is assigned as follows:BackgroundFilename=“{Page number(s)};FileName;{Page number(s)};FileName;...“
Description |
Value |
Effect |
Page number(s) |
not specified or “All” |
Distribute on all pages |
Distribute on all pages |
Distribute on odd pages |
|
“Even” |
Distribute on even pages |
|
“First” |
Only on the first page |
|
“Last” |
Only on the last page |
|
“NoFirst” |
All pages except the first |
|
“NoLast” |
All pages except the last |
|
Number |
Only on page number |
|
Number1-Number2 |
From page Number1 to Number2 |
|
Number1-Number2,Number3, ...,NumberN-NumberM |
Distribute on several pages or page areas (comma as separator) |
|
FileName |
Path to file |
The pages of this file are stored |
BackgroundAdjustment (since version 1.16.1)
|
AllExactMatches FirstExactMatch BestMatch |
|
The page specifications have different priorities, so that lower priorities can be overwritten by higher ones. The priorities are distributed as follows:
Priority None: All, Odd, Even, NoLast, NoFirst
Priority DIRECT: Last, First, Number
Priority RANGE: Number1 – Number2
The following order of priority applies: Priority None < RANGE < DIRECT
If two specifications have the same priority, both apply, otherwise the specification with the higher priority applies and the specification with the lower priority is not used.
If a page of a background document is to be distributed on different pages by several page specifications, these must be separated by commas. For example, First, Last means that the page should be placed behind the first and last page of the input document.
A background document can consist of several pages. In this case, several pages can be specified per file, separated by semicolons (e.g. {First,Last;Even} This way, the first page of the stationery is placed on the first and last page of the main document and the second page on all remaining even pages). The first specification thus refers to the first page of the background document, the second specification to the second page, and so on. Note that the page specifications must be placed in curly brackets as soon as they refer to several pages. This allows great flexibility in specifying on which pages of the main document which page of the background documents is to be stored. The property "BackgroundFilename" can also be used to specify several stationery statements one after the other.Additional instructions
To express that certain instructions are to apply in addition, the information should be separated by curly brackets.
Everything inside the curly brackets is governed by the priorities mentioned above, but no priority is given between the curly brackets.
If one side of the stationery is not to be used, simply enter a 0.
{1;0;2} thus means that the first page is placed behind the first page of the main document, the 2nd page behind none and the 3rd page behind the 2nd page.
The following examples illustrate the use of the stationery functionality:
Examples
The examples show possible calls via the CIB runshell.
The command line of the examples reads as follows:
1. Set Backgroundfilename Property
2. Runshell command PDF-Join = cibrsh.exe –fj
3. input output
A. cibrsh.exe
BackgroundFilename=“{First;All};backgrounds.pdf“ –fj content.pdf output.pdf
Here the first page of backgrounds.pdf is placed behind the first page of
content.pdf, and the second page of backgrounds.pdf is placed behind the
remaining pages of content.pdf. The result is saved in output.pdf.
B. cibrsh.exe
BackgroundFilename=“First;firstbackground.pdf;All;normalbackground.pdf“
–fj content.pdf output.pdf
Here the first page of firstbackground.pdf is placed behind the first page of
content.pdf, and the first page of normalbackground.pdf is placed behind the remaining
pages. B. does the same as A., except that the two pages of the background are
now spread over two files.
C. cibrsh.exe
BackgroundFilename=“{Odd;Even};background.pdf;1-2;mainbackground.pdf“
–fj content.pdf output.pdf
Here the first page of mainbackground.pdf is placed behind the first and second
page of content.pdf (because of higher priority of "1-2" over
"Odd" and "Even"), the first page of background.pdf is
placed behind all remaining odd pages of content.pdf and the second page of
background.pdf is placed behind all remaining even pages of content.pdf.
D. cibrsh.exe
BackgroundFilename=“{1;2;3;4;5;6;7;8};background_8Pages.pdf“ –fj
content.pdf output.pdf
Here the first page of background_8Pages.pdf is placed behind the first page of
content.pdf, the second behind the second, the third behind the third and so
on.
E. cibrsh.exe
BackgroundFilename=“{First;All};backgrounds.pdf“ –fj
content1.pdf;content2.pdf;content3.pdf output.pdf
First, a regular join of the three input documents (content1.pdf ... content3.pdf)
is carried out and then the stationery is deposited as described under A.
Remarks on pages in different formats
A page can only be backed with another page if the heights and widths are the same, with a tolerance of 3 pt. This means that the side to be backed may be no more than 3 pt (equivalent to 0.35 mm) higher or wider than the other.
Two pages can only be mixed together if their heights and widths are the same (up to a tolerance of 3 pt). If no letter paper fits, a warning is issued in the trace but no program termination is generated.
Since version 1.16.1 of the CIB pdf toolbox the selection of the background page can be controlled via the BackgroundAdjustment property: Selection of the first exactly fitting background page or selection of the best fitting background page.
If one of these two options is set and the background page fails, the program is aborted and an error message (366) is displayed.
If you want to add a background to a document that consists of a mixture of horizontal and vertical pages, this is possible if the background document contains pages for both formats.
However, the pages for the different formats must not be distributed over several files.
Examples with different formats
cibrsh.exe BackgroundFilename=“{All;All};backgrounds.pdf“ –fj AlternatingFormats.pdf output.pdf
The first page of backgrounds.pdf is a page in horizontal format, the second page is a page in vertical format. The input file consists of both horizontal and vertical pages, where all horizontal pages are placed with the first page of backgrounds.pdf and all vertical pages with the second page of backgrounds.pdf
Natürlich kann man auch hier verschiedene Seitenangaben machen, wie etwa BackgroundFilename=“{Odd;Even;Odd;Even};backgrounds.pdf“
Of course, you can also enter different page specifications here, such as BackgroundFilename="{Odd;Even;Odd;Even};backgrounds.pdf".
Here, the file backgrounds.pdf consists of 4 pages, the first two in horizontal format, of which the first one is deposited on all odd horizontal format pages and the second one on all even horizontal format pages. The third and fourth pages are in vertical format and are to be placed on odd and even vertical format pages respectively.
15.2. Overlay function
GeneralText
Graphic
Barcode
Releaseplan
General
The overlay function for the CIB pdf toolbox allows the insertion of graphics and text at any position in PDF files. In the following, the entire range of functions is specified in more detail.
By specifying the "Overlay" property when calling PDF-Join, instructions for the overlay function can be specified. The "Overlay" property contains the following information:
- A plane and position indication with optional size indication. For graphics, it is possible to specify their height and width, for texts this specification is omitted.
- A font specification (for texts) with optional rotation.
- A page selection with and without priorities.
- Additional data, consisting alternatively of:
- A filename.
- A text string, which can optionally contain {PAGE}, {NUMPAGES} or {DATE} in the middle.
- A barcode specification, starting with „BARCODE:“
<Overlay>:= <TextOverlay>*;<GrafikOverlay>*;<BarcodeOverlay>*
<TextOverlay>:=
POS:Plane|X-Position;Y-Position;PageReference;FONT:Font;Font-Size;Font-Style;Font-Color;[Orientation] (since Toolbox 1.2.56);Text
<GrafikOverlay>:= (since Toolbox 1.2.56) :=
POS:Plane|X-Position,Width;Y-Position,Height;PageReference;Graphic
<BarcodeOverlay>:= (since Toolbox 1.4.84):=
POS:Plane;X-Position;Y-Position;PageReference;BARCODE:Type;Value;Orientation;Width;Height;CheckNumber
These property specifications are specified in more detail below, divided into text, graphics and barcodes. These can be specified in the "Overlay" property as often as required, separated by ";". Please note that the keyword specification is case-sensitive.Text
The texts specified in the "Overlay" property are placed at the desired position in the result document of the join.
The priorities are regulated here in the same way as described in the Stationery section.
The keyword POS: identifies the position part of the specification and the keyword FONT: the part containing the font information.
Name |
Value |
Effect |
Plane |
Negative number |
Arrangement behind all elements that are already in the document. The smaller the number, the further back the text is inserted. (To arrange several texts in the background) |
Positive Number (including 0) |
0 indicates the text that is inserted first. The larger the number, the further ahead the text is inserted. A positive number means that the text will be placed in front of all elements already in the document.
|
|
“Top” |
Right in the front. If several texts are marked by "Top", they are inserted in the call sequence, i.e. the text mentioned last is placed at the very front of the document. |
|
not specified (The separator must still be specified). |
Corresponds to „-1“
Note: As separators "|" or "/" are possible. |
|
X-Position |
„Center“ |
Center on page in horizontal direction. |
0 or not specified |
Left margin |
|
Number > 0 |
Distance from left in mm |
|
Y-Position |
„Center“ |
Center on page in vertical direction. |
0 or not specified |
Upper margin |
|
Number > 0 |
Distance from top in mm |
|
Font |
Helvetica Courier Times |
The font can be specified here. Possible are the Type1 standard fonts from Pdf. |
Font-Size |
Positive number Half steps also possible e.g. 3.5 Alternatively, by specifying <width>,<height> a dynamic font size is possible. (since CIB pdf toolbox 1.4.78) |
Font size in pt or width and height in mm.
The text is enlarged proportionally until it reaches the smaller value of width or height. Possible rotations only take place after scaling. |
Font-Style |
bold |
Text is printed bold |
italic |
Text is printed in italics |
|
Font-Color |
RGB code, components separated by dots. (R.G.B) Example: 0.0.0 = Black 255.0.0 = Red 0.128.0 = Green 0.0.255 = Blue Default: black (the separator ";" must still be specified) |
The text is displayed in the specified color. The colour components must be indicated separated by dots. |
Orientation (since CIB pdf toolbox 1.2.56) |
Angle > 0 |
The text is rotated clockwise by this angle |
Page number(s) |
Not specified or “All” |
Distribute on all pages |
“Odd” |
Distribute on odd pages |
|
“Even” |
Distribute on even pages |
|
“First” |
Only on the first page |
|
“Last” |
Only on the last page |
|
“NoFirst” |
All pages except the first |
|
“NoLast” |
All pages except the last |
|
Number1-Number2 |
From page Number1 to Number2 |
|
Number1-Number2,Number3, ...,NumberN-NumberM |
Distribute on several pages or page areas (comma as separator) |
|
Text (at this time any text and {PAGE},{DATE},{NUMPAGES} is supported (without start number and number type), since CIB pdf toolbox 1.2.56) |
Any text (can also contain the following Word fields) |
The specified text is inserted into the document. If several Word fields are entered consecutively, they must be separated by at least one blank. |
{PAGE \* start number \* number type} The following values are possible for "numbertype": Arabic = 1,2,3.... ArabicDash = -1-,-2-,-3-... alphabetic = a,b,c.... ALPHABETIC = A,B,C… roman = i,ii,iii…. ROMAN = I,II,III.... |
Inserts the current page number, the options allow you to specify start number and type of numbering. |
|
{NUMPAGES \*numbertype} |
Inserts the number of pages in the document. |
|
{DATE \@ dd.MM.yyyy hh:mm:ss} |
Inserts the current date in the desired format. |
The page specifications have different priorities, so that lower priorities can be overwritten by higher ones. The priorities are distributed as follows:
Priority None: All, Odd, Even, NoLast, NoFirst
Priority DIRECT: Last, First, Number
Priority RANGE: Number1 – Number2
The following order of priority applies: Priority None < RANGE < DIRECT
If two indications concerning a particular page have the same priority, both apply, otherwise the one with the higher priority applies and the lower priority indication is not applied.
The examples show possible calls via the CIB runshell.
The command line of the examples reads as follows:
- Property Overlay
- Runshellcommand PDF-Join = cibrsh.exe –fj
- input output
- cibrsh.exe Overlay=“POS:-1|Center;20;All;FONT:Helvetica;12;bold;0.0.0;;Infoblatt” –fj inhalt.pdf output.pdf
Here the text "Info sheet" is inserted
on the backmost level (-1), centered in horizontal direction (Center), 2 cm
from the top edge (20), in Helvetica font and font size 12, bold, on all pages
(All) of the document content.pdf with the font color black. The
result is returned in output.pdf.
- cibrsh.exe Overlay=“POS:Top|180;280;All;FONT:Helvetica;10;italic;255.0.0;;{PAGE}“–fj inhalt.pdf output.pdf
Here, on the front level (Top) 18 cm from the left and 28 cm from the top in Helvetica font and font size 10 italics, the current page number is inserted on each page of the document input.pdf in Arabic with font colour red (1,2,3...). The result is returned in output.pdf.
- cibrsh.exe Overlay=“
POS:2|20;20;First,Last;FONT:Helvetica;24;;0.0.255;;TextVorn;
POS:1|30;30;First,Last;FONT:Helvetica;24;;255.0.0;;TextMitte;
POS:0|40;40;First,Last;FONT:Helvetica;24;;0.128.0;;TextHinten;
“ –fj inhalt.pdf output.pdf
Here, first 4cm left and right from the edge are removed, the text " TextBack" is inserted in Helvetica font and font size 24 with font color green on the first and last page of the document input.pdf.
Before this (1) 3cm from both edges are removed. The text "TextMiddle" with font colour red and again in front of (2) 2cm from the edge "TextFront" "with font colour blue is inserted. This allows the effect that several texts are written offset one above the other. The result is returned in output.pdf.
Graphic
This functionality is supported since Toolbox 1.2.56. The formats allowed so far are bmp, jpg, gif and png.
The graphics specified in the "Overlay" property are placed at the desired position in the result document of the join.
The priorities are regulated here in the same way as described in the Stationery section.
The "Overlay" property is assigned as follows:
[POS:Layer|X-Position,Width;Y-Position,Height;]Page Specifications;Graphic
Name |
Value |
Effect |
Layer Same as Text |
|
|
X-Position Same as Text |
|
|
Width |
“ScaleToPage” |
Adjust to page width. |
0 or not specified |
Original width of the graphic(1 pixel=1 pt=1/72in) |
|
Number > 0 |
Width of the graphic in mm. |
|
Y-Position Same as Text |
|
|
Height |
“ScaleToPage” |
Auf Adjust to page height. |
0 or not specified |
Original height of the graphic(1 pixel=1 pt=1/72in) |
|
Number > 0 |
Height of the graphic in mm. |
|
Page number(s) Same as Text |
|
|
Graphic |
Path to graphic file |
The graphic from this file is inserted |
(since version 1.4.83) MEMORYBLOCK: <memoryblock-Delimiter>;<memoryblocks> <memoryblocks> ::= memoryblock::=
|
The graphic can also be transferred in memory. For this purpose the memory addresses are transferred to the CIB pdf toolbox. A <memory block delimiter> is a single character unequal to ";", which if possible does not occur in a file name, e.g. "#", "?". Address and length are decimal numbers. |
Instead of a file name, you can specify that a colored rectangle, line or Bezier curve is to be placed at the specified location. The file name must then be replaced as follows:
RECT:Color[;Orientation;Transparency]
LINETO:Color;X2,Y2
BEZIERTO:Color;SX1,SY1,SX2,SY2,X2,Y2
Lines and Bezier curves have no width and height indication. They cannot be centered using the "Center" value for X and Y position. The specification of this value is interpreted as "-1".
Name |
Value |
Effect |
RECT: Color (since CIB pdf toolbox 1.2.56) LINETO: Color BEZIERTO: Color (since CIB pdf toolbox 1.4.75) |
RGB code, components separated by dots. [R.G.B.] Examples: 0.0.0 = black 255.0.0 = red 0.128.0 = green 0.0.255 = blue |
The rectangle or line or Bezier curve is displayed in the specified color. The colour components are to be indicated separated by dots. |
Orientation |
> 0 |
Rectangle is rotated clockwise by the specified angle. |
Transparency |
> 0 |
Degree of transparency for the rectangle Example: 75 means that the rectangle is 75% transparent. A transparency of 100% means that the rectangle becomes invisible. |
X2 (X coordinate for the end point of the line or Bezier curve)) |
0 |
Left margin |
|
Number > 0 |
Distance from left in mm. |
Y2 (Y-coordinate for the end point of the line or Bezier curve) |
0 |
Upper edge. |
|
Number > 0 |
Distance from top in mm. |
SX1, SX2 (X-coordinates for the first and second point of the Bezier curve) |
0 |
Left edge. |
|
Number > 0 |
Distance from left in mm. |
SY1, SY2 (Y-coordinates for the first and second point of the Bezier curve) |
0 |
Upper edge. |
|
Number > 0 |
Distance from top in mm. |
The examples show possible calls via the CIB runshell.
The command line of the examples reads as follows:
- Property Overlay
- Runshellkommando PDF-Join = cibrsh.exe –fj
- input output
1) cibrsh.exe Overlay=“POS:-1|Center,100;Center,100;Odd;Graphic.jpg“ –fj content.pdf output.pdf
Here, on the backmost level (-1), centered in X-direction and Y-direction (Center), the image Graphic.pdf is inserted on all odd pages (Odd) of the document content.pdf. This will be scaled to the dimensions 10x10 cm. The result is returned in output.pdf.
2) cibrsh.exe Overlay=“POS:Top|20,0;Center,0;2-8;Graphic.jpg“ –fj content.pdf output.pdf
Here, the image Graphic.jpg in original size is inserted on the front level (Top) 2 cm from the left and centered in Y-direction on pages 2-8 of the document Input.pdf The result is returned in output.pdf.cibrsh.exe Overlay=“POS:Top|Center,ScaleToPage;Center,ScaleToPage;First;Grafik.jpg“ –fj inhalt.pdf output.pdf
Here, the image Graphic.jpg is inserted on the top level (Top), page-centered in both X and Y direction, on the first page of the document input.pdf. The image is scaled to the dimensions of the page. The result is returned in output.pdf.
3) cibrsh.exe Overlay=“POS: Top|180,10;280,10;All;RECT: 255.255.255;POS:Top|180;280;All;FONT:Helvetica;10;italic;0.0.0;;{PAGE}“ –fj content.pdf output.pdf
Here, a white rectangle measuring 1cm x 1cm is first inserted on the front level (top) 18 cm from the left and 28 cm from the top. Then, in Helvetica font and font size 10 italics, the current page number is inserted in Arabic at this point on each page of the document input.pdf (1,2,3...) The result is returned in output.pdf.
4) cibrsh.exe Overlay=“POS:Top|0;0;All;LINETO: 255.0.0;210,297;“ –fj content.pdf output.pdf
Here, a red line is inserted at the front level (Top) from the upper left edge (0.0) to the lower right edge (210.297). The result is returned in output.pdf.
5) cibrsh.exe Overlay=“ POS:Top|0;150;All;BEZIERTO: 255.255.255;100,60,150,110,210,150“ –fj content.pdf output.pdf
Here, a red Bezier curve with a starting point (0,150), end point (210,150) and the support points (100,60) and (150,110) is inserted at the front level (Top). The result is returned in output.pdf.
Barcode
(since CIB pdf toolbox Release 1.4.84)
The barcodes specified in the "Overlay" property are placed at the desired position in the result document of the join.
The priorities are regulated here in the same way as described in the Stationery section
The "Overlay" property is assigned as follows:
[POS:Level|X-Position;Y-Position;] PageReferences;BARCODE:Type;Value;Orientation;Width;Height;CheckDigit;CodePage
QR [POS:Level|X-Position;Y-Position;] PageReferences;BARCODE:QR;Type;Value;Orientation;Width;Height;CheckDigit;CodePage;CorrectionLevel
Name |
Value |
Effect |
Level Same as Text |
|
|
X-Position Same as Text |
|
|
Y-Position Same as Text |
|
|
Pagenumber(s) Same as Text |
|
|
Type |
A barcode type from the set of types supported by CIB format:
Code ITF Code 2/5 Industry Code 2/5 Matrix Code 39 Code 39 extended Code 128 (A, B, C) EAN 8 EAN 13 EAN 128 DataMatrix PDF417 Code 93 Code 93 Extended OMR Barcodes QR |
This barcode type is used |
Value |
Numbers |
The individual value that the barcode should represent. |
Orientation |
horizontalleft |
Vertical lines side by side, first character left.
|
horizontalright |
Vertical lines side by side, first character on the right. |
|
verticalleft |
Horizontal lines below each other, first character on top. |
|
verticalright |
Horizontal lines above each other, first character below. |
|
Width |
Line width in mm (x.xmm; or x,xmm both allowed) |
Sets the bar width of the barcode |
Height |
Height of the barcode bars in mm (x.xmm; or x,xmm both allowed) |
Sets the height of the barcode bars |
Check digit / CorrectionLevel
(since version 1.26.0) |
default |
Barcode is generated with check digit |
nochecksum |
Barcode is generated without check digit |
|
The check digit is not available for 2D barcodes (QR). The default is therefore nochecksum. However, the correction level (ECL) can be specified here. The level goes from 0 (low correction) to 3 (maximum correction = default). |
|
|
Codepage |
Specifies code page for QR barcode data. Default: Ansi; Possible Values:
|
Note: |
Size (since version 1.26.0) |
QR Code: The size has not been used so far. Now the version can be specified here. |
The size of the QR Code is determined by the version. Example: |
For the assignment of the parameters after "value", please refer to the corresponding documentation regarding barcode realization in CIB format. Which parameters must be assigned which value depends strongly on the barcode type.
Releaseplan
The overlay function is implemented in several stages. The functionality must be implemented according to the following step plan:
- Specification of the Word mail merge field {PAGE} with default option Arabic, possibility to specify font, size, color and position of the text itself.
- Logos without rotation.
- arbitrary text with rotation.
- Support for other fields (like {NUMPAGES} or {DATE} with options anywhere in the text.
- Barcode support.
It must be examined to what extent the layer function can be used or supported. Please note that this is not included in PDF 1.3 and is not supported by older viewers.
Since Toolbox 1.2.56, overlay of text (including rotation), graphics and rectangles are supported.
15.3. Implementation notes
The following points out special features of the implementation.
Overlayfunction
Stationery function
General procedure:
- The string of the Property BackgroundFilename is parsed. For each specified page a PropertyInfo object is created and added to a PointerArray. Each PropertyInfo contains the following information:
- An array with PageSettings. This contains the information, behind which page the page of the stationery comes. The index in this array corresponds to the page Main Document. If it contains a -1, it means that the page does not come after the corresponding page of the main document. All other specifications mean that it comes after.
- An index (indicates the number of pages of the stationery document)
- A file name (associated stationery file)
- The parsing is done as follows:
- The information separated by curly brackets (if there are several) is broken down (separator= "}{")
- Position data is read out and stored
- The page numbers (which are optionally in curly brackets), which can be separated by ";" to indicate several pages of the stationery, are split up.
- The file name is determined
- The page specifications are used to fill the array of PageSettings.
- The information within curly brackets is regulated by Prios.
- Depending on the priority, the numbers 0, 1, 2 are first entered in the individual PageSettings of the InfoObjects (-1 default)
- If the arrays of the InfoObjects of a bracket are occupied, they still have to be compared with one another. Higher prios overwrite the lower ones, so that whenever the same position is occupied in 2 PageSetting arrays, the higher number wins and the position of the lower one is occupied with -1.
- First a normal PdfJoin is carried out with the input files, then the background files are processed. Here, the same procedures are run through as for the normal join, except that instead of the method which builds a new PageTree, a method is called which mixes the contents.
- In this method, the property info is run through and checked whether or not the page should be stored based on the page settings.
- If the correct BackgroundPage was found, a new Xobject is created from the background page:
- GetContentstreamAsString() retrieves the content of the page and creates a new dictionary.
- From this a new stream is created and inserted into the main document as a new object.
- This object is converted to a form Xobject by setting the corresponding entries in its dictionary:
- Type /XObject
- Subtype /Form
- BBox corresponds to the MediaBox of the page
- Name must be a name that uniquely identifies the object within the page, so it is necessary to check whether the name already exists and possibly assign a different one
- The Resources Dictionary corresponds to the background page
- Nun muss noch ein neues ContentStream-Objekt erzeugt werden, das auf das neues XObject referenziert und dem Dokument hinzugefügt werden: q XObjectName Do Q
- The reference to this object is then added to the ContentArray of the main page (in front, so that it is in the background)
- The xobjects are managed in an array, so that only one is created for each background page, and can be retrieved from the array when needed
- The annotations of the two pages are merged by adding the references to annotations of the background page to the annotation array of the main page. Possibly /P - entries are removed.
The AcroForms of the second page must also be added to the first.
Overlayfunction
General procedure:
- The content of the property overlay is parsed. The default values are used if no position is specified. The same parser is used and PropertyInfo objects are created.
- These objects contain information about position, width/height (graphic), file name (or text).
- The generated information is managed in an array or from an array. After the join, the main document is merged with the corresponding overlay information.
- For each page of the main document, the PropertyInfo array is searched for elements whose PageSettings are compatible with the current page. If one is found, either the corresponding graphic or the corresponding text must be inserted into the main document.
- For each appropriate indication, the following procedure must be followed in the case of a text:
- You get the content of the page using GetContentstreamAsString(), depending on whether you want the text in front of or behind the content of the page, a new content stream has to be created, in which the new part is placed either in front of or behind the old part:
- q <old contentstream> Q q <contentstream for text to be inserted> Q“
- The ContentStream for the text to be inserted must look as follows:
BT
/F13 12 Tf
288 720 Td
(ABC) Tj
ET
- BT marks the beginning, ET the end
- /F13 is the name of the font to be used
- 12 the font size
- 288 720 are the position data
- ABC is the text to be inserted
- This refers to a font called F13. This font must be referenced in the Resources Dictionary of the page:
/Resources
<< /Font << /F13 23 0 R >>
>>
23 0 obj
<< /Type /Font
/Subtype /Type1
/BaseFont /Helvetica
>>
endobj
- This means that for each font specified in the property overlay, a font object must be created as described above.
- Here too, care must be taken to ensure that the names are unique within the page.
- Implementations for graphics and barcodes will be added in the future.
16. CIB ocr
OCR (optical character recognition) is used to extract text from images.
With CIB pdf toolbox, all properties of the CIB ocr deepER can be used for this purpose.
The individual properties are described in the technical guide CIB ocr.
17. Using test templates
With test templates it is possible to check whether a PDF page contains content, at which position and whether the content is permitted or mandatory at this position or whether it is undesirable.
The special properties to be set are described in detail below.
Propertyname |
Type |
Functionality |
CheckMask (since CIB pdf toolbox) |
String |
Describes the structure of the concrete test templates. The individual components are described in more detail below. Structure: <Checkmasklist> ::= <Checkmask> | <Checkmask> „;“ <Checkmasklist> Several definitions for test templates can be strung together. They are separated by semicolons. Example: CheckMask=“{{1,3-40}; {forbidden;2cm;2cm;5cm;4cm}}; {{2,5,6};{allowed;2cm;2cm;5cm;4cm};{mandatory;1cm;1cm;6cm;7cm}};“ |
<Checkmask>
|
String |
Description of a template. Structure: The template areas are described for the pages for which a test template is to be used. For each <Checkmask>, either "allowed", "forbidden" or "mandatory" areas or even combinations of these areas can be described. |
<mask area> |
|
Description of the test template area (rectangle). Structure: Forbidden no text allowed in this rectangle Allowed text is allowed in this rectangle Mandatory This rectangle must contain text left;top Coordinates of the upper left corner point of the rectangle (see point A) right;bottom Coordinates of the lower right corner point of the rectangle (see point B) ID Specification of an identifier (ID) that is output in the CheckMaskViolations The reference point for the coordinates is the upper left corner of the page. By entering negative values, the reference point can be changed to the lower right corner of the page. The following units are supported: mm, cm, in, ft; Default: mm |
<Pages> |
|
Specifies the pages or page areas on which the following test template is to be applied. The pages can be specified in relation to the whole document or to a single copy. If the test template is to be applied to all pages of a copy, "All" must be added to the text marker.
Structure:
First (only the first page), NoFirst (no first page), Last (only the last page), NoLast (not the last page), Even (Even numbers) Odd (Odd numbers) All (all pages) Value (This page) Value1-Value2 (this page area) Value1-Value2[,]Value3 (These pages/ page areas)
|
CheckMaskViolations |
String |
Property returns the violations of the test templates. (Get-Property). An identifier (ID) can be assigned to each test template. This ID is also given in the output. The following is output: Position of the Checkmask that is violated (masks). Example: …{forbidden;50mm,50mm,150mm,100mm;myid1}. Violations={{content;49.31;52.84;61.66;50.08;};{masks;{50;50;150;100;myid1}}} Output in Trace: (masks). Example: CheckMask: Content is placed on the forbidden area [forbidden;0mm;0mm;150cm;100mm;myid01]. |
CheckMaskThreshold |
String |
Allows you to set a fault tolerance. The value specifies how many pixels in a "forbidden" check mask area are tolerated without causing an injury. Integers can be specified: Default: 1 |
StopOnFirstCheckmaskViolation |
String |
pecifies whether to abort at the first violation that occurs. The violation is stored in the CheckmaskViolations property. Possible values: 0: it is not aborted (default). 1: it is aborted. |
StopAfterCheckmaskViolation |
String |
ecks the entire document and saves all violations in the property and returns an error message. Possible values 0: no error message. 1: Error message and saving all violations |
18. Quick start
This chapter gives a short overview of a possible use of the CIB pdf toolbox from a customer application. The examples by no means use the full range of functions, but demonstrate the basic principle when using the CIB pdf toolbox.
For your specific application, you can also contact CIB Support.
Note:
For quick use of the CIB pdf toolbox via the CIB runshell from the command line, there are ready-made examples in the transfer package. The calls of the CIB runshell are predefined in batch files.
18.1. Integration of the CIB pdf toolbox al C++ code example
GeneralStatic linking of the CIB pdf toolbox
Description of the code example
General
The following example demonstrates the control of the CIB pdf toolbox under C++.
The files used in the code example are adapted to the examples included in the scope of delivery, thus ensuring immediate functionality for test purposes.
The code example was translated in Microsoft Visual Studio C++ 6.0. The project file for this development environment is also included.
For an integration into your own project please note:
- Should the dll be applied statically or dynamically? The code example uses the static inclusion.
- Connection to the own error handling. The code example contains a minimal text-based error output. The handling of error codes is demonstrated here.
- Connection to the own document requirements. The code example contains hard-coded file names and is for demonstration purposes only. The administration must be completely adapted to your own requirements
Note:
This example represents a functioning overall process. For information on how to search for individual functions and their possible variants, please refer to the documentation, help and CIB Support.
Static linking of the CIB pdf toolbox
// CibPdfDll.cpp : Loads the CIB pdf toolbox statically from a specific path
#include “stdafx.h”
#include <stdio.h>
#include <windows.h>
#include “CibPdfDll.h”
// Samplepdftoolbox.cpp : Defines the entry point for the console application.
//
#include “stdafx.h”
#include <stdio.h>
#include <windows.h>
#include “..\bin\cibpdf.h”
int main(int argc, char* argv[])
{
printf(„Performing the pdfmerge XML samples:\r\n\r\n“);
//Generate a separate output file for each record (true)
BOOL t_bRet = CibPdfSetProperty(“MultiOutput”, “1”);
//Specification of the PdfMerge input request, such as XML:data.xml;<xpath>
t_bRet &= CibPdfSetProperty(“Data”, “XML:..\\merge xml\\data.xml;//Testdaten//Person”);
//Specifying the input file
t_bRet &= CibPdfSetProperty(„InputFilename“,“““..\\merge xml\\test.pdf“““);
//Specifying the output file
t_bRet &= CibPdfSetProperty(„OutputFilename“,“..\\tempoutput\\mergeXMLoutput.pdf“);
if(!t_bRet)
{
printf(„Error when setting the properties for CIB pdf merge\r\n\r\n“);
getchar();
return 0;
}
//Performing the merge run
t_bRet = CibPdfMerge();
if(t_bRet)
{
printf(„Status:\r\nCIB pdf merge successfully implemented in mergeXMLoutput.pdf durchgefuehrt\r\n“);
printf(„Please press [Return] to continue the demo\r\n\r\n“);
getchar();
}
else
{
int t_FehlerNr;
if(!CibPdfGetLastError(&t_FehlerNr))
{
printf(„Error occurred. The error number cannot be read out“);
getchar();
return 0;
}
printf(„Error %d while performing CIB pdf merge\r\n“, t_FehlerNr);
const int t_BufferLength = 1024;
char t_Fehlertext[t_BufferLength];
if( !CibPdfGetErrorText(t_FehlerNr, t_Fehlertext, t_BufferLength))
{
printf(„Error occurred. The error number cannot be read out“);
getchar();
return 0;
}
printf(„Error: %s“, t_Errortext);
getchar();
return 0;
}
printf(„Performing the CIB pdfjoin sample:\r\n“);
//Of the 3 input files, the first is encrypted. Therefore pass a password
t_bRet = CibPdfSetProperty(„EncryptOwnerPassword“, „test1o;;“);
//The output file should be encrypted (Userpassword), // i.e. it is queried by the reader when opening)
t_bRet &= CibPdfSetProperty(“OutputUserPassword”, “outputu”);
//Specification of the 3 input files
t_bRet &= CibPdfSetProperty(„InputFilename“,
„..\\join\\test1.pdf;..\\join\\funktionstest1.pdf;..\\join\\functionstest2.pdf“);
//Specifying the output file name
t_bRet &= CibPdfSetProperty(„OutputFilename“,“..\\tempoutput\\joinoutput.pdf“);
if(!t_bRet)
{
printf(„Error setting the properties for CIB pdf join\r\n\r\n“);
getchar();
return 0;
}
//Perform the Join
t_bRet = CibPdfJoin();
if(t_bRet)
{
printf(„\r\nStatus:\r\nCIB pdf join conducted successfully in joinoutput.pdf \r\n“);
printf(„Please press [Return] to continue the demo\r\n\r\n\r\n“);
getchar();
}
else
{
int ErrorNr;
if(!CibPdfGetLastError(&ErrorNr))
{
printf(„Error occurred. The error number cannot be read out“);
getchar();
return 0;
}
printf(„Error %d while running CIB pdf join\r\n“, t_ErrorNr);
const int t_BufferLength = 1024;
char Errortext[t_BufferLength];
if( !CibPdfGetErrorText(t_FehlerNr, t_Errortext, t_BufferLength))
{
printf(„Error occurred. The error text cannot be read out“);
getchar();
return 0;
}
printf(„Error: %s“, t_Errorrtext);
getchar();
return 0;
}
printf(„End of the demo.\r\n“);
getchar();
return 0;
}
Description of the code example
The code example first controls the example 'merge xml' which is stored in the transfer package. The data contained in the XML file 'data.xml' is merged into the form 'test.pdf'. A result document mergeXMLoutput00001.pdf is created for each data record contained in the form. The appended number per data record is ascending. If the 'MultiOutput' property is set to FALSE, only one output file is generated and no number is appended.
Afterwards the example 'join' is used. The 3 files 'test1.pdf', 'Funktionstest1.pdf' and 'Funktionstest2.pdf' are attached to each other. For the encrypted input file 'test1.pdf' the password is specified and the resulting output file 'joinoutput.pdf' is also encrypted with a password.
The output files resulting from both runs are stored in the directory ' tempoutput'.18.2. Integration of the CIB pdf toolbox (PRINT) als VB code example
The following example demonstrates the control of the CIB pdf toolbox under Visual Basic.
The Test.pdf used in the code example can be replaced by any PDF.
Module Print
‚The following program code shows the printing via the CIB pdf toolbox as a VB code example. The starting point is a finished PDF document.
,Error messages and error developments are only partially taken into account here.
‚This example was created using Visual Studio 2008, Visual Basic .NET Framework 3.5.
‚Declaration of the methods that are opened via the "CibPdf32.dll" and output as Long
Private Declare Function CibPdfJoin Lib “CibPdf32.dll” () As Integer
Private Declare Function CibPdfSetProperty Lib “CibPdf32.dll” (ByVal a_PropName As String, ByVal a_pPropValue As String) As Integer
Private Declare Function CibPdfGetProperty Lib “CibPdf32.dll” (ByVal a_PropName As String, ByVal a_pProbValue As String) As Integer
Private Declare Function CibPdfShowPrintDialog Lib “CibPdf32.dll” (ByVal a_ButtonID As Integer) As Integer
Private Declare Function CibPdfGetLastError Lib “CibPdf32.dll” (ByRef a_iError As Integer) As Integer
Sub Main()
‚ The variable t_Return has the data type Long, the return values are stored here
Dim t_Return As Integer
‚1. Defining the necessary properties
‚The input document is specified. This file is printed
t_Return = CibPdfSetProperty(„InputFilename“, „C:\test.pdf“)
‚3. Optionally show a print dialog, which allows the user to make changes
CibPdfShowPrintDialog(0)
‚Set output format. The command "FormatPrinter" prints the document to the printer.
t_Return = CibPdfSetProperty(“OutputFormat”, “FormatPrinter”)
‚2. Optional possible functionalities (only exemplary in this example)
‚Duplex printing is performed with the printer's default settings.
t_Return = CibPdfSetProperty(“DuplexPrint2”, “DuplexPrintLong”)
‚The printer prints the pages 1,2,3,4,5.
t_Return = CibPdfSetProperty(„PageSelection“, „1-5“)
‚1 additional copy is output
t_Return = CibPdfSetProperty(“PrintCopies2”, “1”)
‘Initiate output
t_Return = CibPdfJoin()
If (t_Return = 0) Then
‚Retrieve error number
Dim t_Fehlernummer As Integer
CibPdfGetLastError(t_Errornumber)
End If
End Sub
End Module
18.3. Integration of the CIB pdf toolbox - Java code example
The following examples demonstrate the control of the CIB pdf toolbox under JAVA.
Example for PDF integration from RTF via CIB pdf/joinExample with CIB pdf/merge and CIB pdf/join
JAVA example: Direct printing of a PDF document via CIB runshell and CIB pdf toolbox
Example CIB pdf toolbox direct printing of a PDF document via the Java wrapper (JCoMod)
Example for PDF integration from RTF via CIB pdf/join
If you are using a dynamic RTF document project that also integrates PDF files into the target document, the following procedure is usually provided:
- Via CIB merge, the dynamic document project is first prepared to an RTF result file with the participation of CSV and/or XML data supply.
- The CIB format/pdf component creates a PDF intermediate result file from the RTF result file. This file now contains XMP metadata that provide further instructions for the processing step with the CIB pdf toolbox.
- The CIB pdf toolbox now creates a PDF result file from the intermediate result file
he following JAVA example only describes this last step.
package com.cib.comod.test; import com.cib.comod.jobs.ICibPdfJoinJob; /** • Example implementation for using the JCoMod Wrapper with CIB pdf toolbox • Example: • 1) Takes a PDF intermediate result file and outputs it as PDF result file. • 2) XMP metadata contained internally in the PDF is processed. * */ public boolean doPdfJoinJob(String a_Input, String a_Output, String a_Workspace) { JCibPdfJoinJob t_PdfJob = new JCibPdfJoinJob(); t_PdfJob.initialize(); if (!t_PdfJob.isInitialized()) { System.out.println(„Error initializing the JCibPdfJoinJob“); t_PdfJob.dispose(); // Release job resources return false; } //t_PdfJob.setProperty(ICibPdfJoinJob.PROPERTY_LICENSEKEY, “...”); //t_PdfJob.setProperty(ICibPdfJoinJob.PROPERTY_LICENSECOMPANY, “...”); //PDF intermediate result from CIB format/pdf conversion //must contain the attached PDF file as XMP Metainfo t_PdfJob.setProperty(ICibPdfJoinJob.PROPERTY_INPUTFILE, „input.pdf“); //PDF result document to be generated t_PdfJob.setProperty(ICibPdfJoinJob.PROPERTY_OUTPUTFILE, „output.pdf“); //Execute Job t_PdfJob.execute(); //Error handling int t_Error = ((Integer)t_PdfJob.getProperty(ICibPdfJoinJob.PROPERTY_ERROR)).intValue(); if (t_Error != 0) { // Error while executing the job String t_Errortext = (String) t_PdfJob.getProperty(ICibPdfJoinJob.PROPERTY_ERRORTEXT); System.out.println(„execution error: „+t_Error+“ „+t_Errortext); t_PdfJob.dispose(); // Release job resources return false; } t_PdfJob.dispose(); // Release job resources return true; }
Example with CIB pdf/merge and CIB pdf/join
The following Java code must be inserted into a "PdfToolboxSample" Java class. In addition, the Java JCoMod Wrapper (at least version 2.0.20) is required, which encapsulates the CIB pdf toolbox native library for Java via JNI, thus enabling simple control from Java.
The wrapper consists of these files:
- CoModJobs.jar
- JCoMod.dll
To compile the example, the CoModJobs.jar must be specified in the classpath. At the time of development a JDK 1.4.1 was installed.
The files used in the code sample are matched to the samples included in the scope of delivery, thus ensuring immediate functionality for test purposes.
import java.awt.Color; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JRadioButton; import javax.swing.JScrollPane; import javax.swing.JTextField; import com.cib.comod.jobs.ICibPdfJoinJob; import com.cib.comod.jobs.ICibPdfMergeJob; import com.cib.comod.jobs.IComodJob; import com.cib.comod.jobs.JCibPdfJoinJob; import com.cib.comod.jobs.JCibPdfMergeJob; public class PdfToolboxSample extends JFrame { JTextField TextPdf1; JTextField TextPdf2; JTextField TextOut; JTextField TextData; JList FieldList; JRadioButton RadioJoin; JRadioButton RadioMerge; public PdfToolboxSample() { makeFrame(); } public void makeFrame() { //Create window setTitle(“PdfToolboxSample”); setSize(400,400); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Create controls RadioMerge = new JRadioButton(new RadioMergeAction()); RadioJoin = new JRadioButton(new RadioJoinAction()); TextPdf1 = new JTextField(“..\\merge xml\\test.pdf”); TextPdf2 = new JTextField(“..\\join\\test1.pdf;..\\join\\functiontest1.pdf;..\\join\\functiontest2.pdf”); TextData = new JTextField(“XML:..\\merge xml\\data.xml;//Testdata//Person”); TextOut = new JTextField(“..\\tempoutput\\Output.pdf”); //Create labels JLabel LabelPdf1=new JLabel(„Pdf file 1:“); JLabel LabelPdf2=new JLabel(“Pdf file 2:”); JLabel LabelData=new JLabel(“Data file:”); JLabel LabelOut=new JLabel(“Output file:”); JLabel LabelFields=new JLabel(“Pdf Fields:”); //set the right dimensions RadioJoin.setSize(70,25); RadioMerge.setSize(70,25); LabelPdf1.setSize(70,25); TextPdf1.setSize(280,25); LabelPdf2.setSize(70,25); TextPdf2.setSize(280,25); LabelData.setSize(50,25); TextData.setSize(280,25); LabelOut.setSize(70,25); TextOut.setSize(280,25); LabelFields.setSize(70,25); //set the right positions RadioJoin.setLocation(100,30); RadioMerge.setLocation(180,30); LabelPdf1.setLocation(20,60); TextPdf1.setLocation(100,60); LabelPdf2.setLocation(20,90); TextPdf2.setLocation(100,90); LabelData.setLocation(20,120); TextData.setLocation(100,120); LabelOut.setLocation(20,150); TextOut.setLocation(100,150); LabelFields.setLocation(20,180); FieldList = new JList(); JScrollPane FieldsPane = new JScrollPane(FieldList); FieldsPane.setVerticalScrollBarPolicy (JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); FieldsPane.setSize(280,100); FieldsPane.setLocation(100,180); //create a button to execute join and merge JButton ButtonExecute = new JButton(new ExecuteAction()); ButtonExecute.setSize(100,25); ButtonExecute.setLocation(100,320); //put everything on the window getContentPane().setLayout(null); getContentPane().add(RadioMerge); getContentPane().add(RadioJoin); getContentPane().add(ButtonExecute); getContentPane().add(LabelPdf1); getContentPane().add(TextPdf1); getContentPane().add(LabelPdf2); getContentPane().add(TextPdf2); getContentPane().add(LabelData); getContentPane().add(TextData); getContentPane().add(LabelOut); getContentPane().add(TextOut); getContentPane().add(LabelFields); getContentPane().add(FieldsPane); //Preset and display RadioJoin.setSelected(true); enableFields(); setVisible(true); } public static void main(String[] args) { JFrame.setDefaultLookAndFeelDecorated(true); new PdfToolboxSample(); } class ExecuteAction extends AbstractAction { public ExecuteAction() { putValue(Action.NAME, “Execute”);} public void actionPerformed(ActionEvent e) { execute();} } class RadioJoinAction extends AbstractAction { public RadioJoinAction() { putValue(Action.NAME, “Join”);} public void actionPerformed(ActionEvent e) { RadioMerge.setSelected(false); enableFields();} } class RadioMergeAction extends AbstractAction { public RadioMergeAction() { putValue(Action.NAME, “Merge”);} public void actionPerformed(ActionEvent e) { RadioJoin.setSelected(false); enableFields();} } //Plausibility check of the GUI public void enableFields() { if(RadioJoin == null) return; if(RadioJoin.isSelected()) { TextPdf2.setEnabled(true); TextPdf2.setBackground(Color.white); TextData.setEnabled(false); TextData.setBackground(PdfToolboxSample.this.getBackground()); } else { TextPdf2.setEnabled(false); TextPdf2.setBackground(PdfToolboxSample.this.getBackground()); TextData.setEnabled(true); TextData.setBackground(Color.white); } } //execute Job public void execute() { //choose a Job if(RadioJoin.isEnabled()) doJoin(); if(RadioMerge.isEnabled()) doMerge(); } public void doMerge() { //create a JCibPdfMerge-Job JCibPdfMergeJob t_Job = new JCibPdfMergeJob(); // The job must be initialized, otherwise nothing runs if (!t_Job.initialize()) { System.out.println(„Error while initializing the job“); return; } // set Properties t_Job.setProperty(ICibPdfMergeJob.PROPERTY_INPUTFILE, TextPdf1.getText()); t_Job.setProperty(“Data”, TextData.getText()); t_Job.setProperty(ICibPdfMergeJob.PROPERTY_OUTPUTFILE, TextOut.getText()); t_Job.setProperty(“GetFieldInfo”, “1”); // Execute Merge Job t_Job.execute(); //Evaluate FieldInfos String t_FieldNames = (String) t_Job.getProperty(“FieldNames”); //FieldNames sind ;-separiert if (t_FieldNames != null) { String t_FieldNamesArray[] = t_FieldNames.split(“;”); FieldList.setListData(t_FieldNamesArray); } //Error handling System.out.println(“execute() beendet: “); if (((Integer)t_Job.getProperty(IComodJob.PROPERTY_ERROR)).intValue()>0) System.out.println(“Error while executing: “+t_Job.getProperty(IComodJob.PROPERTY_ERROR)+” “+t_Job.getProperty(IComodJob.PROPERTY_ERRORTEXT)); else System.out.println(„Success\n“); System.out.println(„closed Merge Job\n“); } public void doJoin() { //creates a JCibPdfJoin-Job JCibPdfJoinJob t_Job = new JCibPdfJoinJob(); // The job must be initialized, otherwise nothing runs if (!t_Job.initialize()) { System.out.println(„Error initializing the Job“); return; } // assemble the PDFs to be joined as ;-separated list String t_String = TextPdf1.getText(); if (TextPdf2.getText().toString().length()>0) t_String += „;“; t_String += TextPdf2.getText(); // set Properties t_Job.setProperty(ICibPdfJoinJob.PROPERTY_INPUTFILE, t_String); t_Job.setProperty(ICibPdfJoinJob.PROPERTY_OUTPUTFILE, TextOut.getText()); t_Job.setProperty(“GetFieldInfo”, “1”); // execute Join Job t_Job.execute(); //Evaluate FieldInfos String t_FieldNames = (String) t_Job.getProperty(“FieldNames”); //FieldNames are ;-separated if (t_FieldNames != null) { String t_FieldNamesArray[] = t_FieldNames.split(“;”); FieldList.setListData(t_FieldNamesArray); } //Error handling System.out.println(“execute() beendet: “); if (((Integer)t_Job.getProperty(IComodJob.PROPERTY_ERROR)).intValue()>0) System.out.println(“Error while executing: “+t_Job.getProperty(IComodJob.PROPERTY_ERROR)+” “+t_Job.getProperty(IComodJob.PROPERTY_ERRORTEXT)); else System.out.println(„Success\n“); System.out.println(„Join Job terminated\n“); } }
JAVA example: Direct printing of a PDF document via CIB runshell and CIB pdf toolbox
To execute this example two additional classes are required: RunshellProcess.java and Process.java . You can get them from the CIB Support.
import java.io.*; import de.cib.comod.RunshellProcess; public class DirectPrintPdf { public static void main(String[] args) { //Set PDF file e.g. a test.pdf String inputFileName = new String(“..\\Test.pdf”); // Start a new runshell process RunshellProcess cibRunShell = new RunshellProcess(“cibrsh.exe”); //Set printer names e.g. HP LaserJet 4100 Series PS cibRunShell.addArgument(„PrinterName = \\\““ + „HP LaserJet 4100 Series PS“ + „\\\““); //Set output format cibRunShell.addProperty(„OutputFormat“, „FormatPrinter“); //Set input file cibRunShell.addCommand(RunshellProcess.COMMAND_PDFJOIN, inputFileName); try { //Specify path to the libraries and start process runshell.executeAndWait(new File(“.”)); } catch(IOException io) { io.printStackTrace(); } catch(InterruptedException inter) { inter.printStackTrace(); } }
Example CIB pdf toolbox direct printing of a PDF document via the Java wrapper (JCoMod)
import java.io.*; import com.cib.comod.jobs.*; public class DirectPrintPdf { public static void main(String[] args) { JCibPdfJoinJob t_PDFJob = new JCibPdfJoinJob(); t_PDFJob.initialize(); if (!t_PDFJob.isInitialized()) { System.out.println(„Error while initializing the Dll“); return; } //Set PDF file e.g. a test.pdf t_PDFJob.setProperty(ICibPdfJoinJob.PROPERTY_INPUTFILE, “Test.pdf”); //Set printer names e.g. HP LaserJet 4100 Series PS t_PDFJob.setProperty(„PrinterName“, „HP LaserJet 4100 Series PS“ ); //Set output format t_PDFJob.setProperty(ICibPdfJoinJob.PROPERTY_OUTPUTFORMAT, “FormatPrinter”); //Start process t_PDFJob.execute(); int t_ReturnValue =(Integer)t_PDFJob.getProperty(ICibPdfJoinJob.PROPERTY_ERROR)).intValue(); if (t_ReturnValue != 0) { System.out.println(“Error! CIB pdf toolbox returns “ + t_ReturnValue); } t_PDFJob.dispose(); }
19. Programm return codes
The following list gives an overview of possible error returns by CIB pdf toolbox. There are interfaces for application developers CoMod to query the text of an error number directly and to help the end user with specific instructions. The functions with which the error texts are retrieved are:
CibPdfGetLastError(int a_iError) und CibPdfGetLastErrorText(char a_pTextBuffer, long a_lBufferLength).
Return Code |
Meaning / Possible cause |
0 |
Everything is in order |
2 |
Property cannot be read |
3 |
Property cannot be changed |
9 |
No input file or input file is faulty |
10 |
Too little working memory to create necessary resources |
11 |
This method is not implemented |
13 |
Printer not found |
14 |
Incorrect letter, font or graphic size |
25 |
Line too long in the parameter file |
26 |
License data incomplete |
28 |
Internal program error. Please send RTF text to CIB Support |
29 |
Invalid function argument |
31 |
Windows standard print dialog cannot be displayed |
34 |
Error during Pdf font embedding with system routine SelectObject |
35 |
Error during Pdf font embedding with system routine GetFontData |
39 |
Invalid table format |
47 |
Transferred return buffer is too small |
48 |
System error occurred during font selection for printer |
52 |
No font directory is set |
58 |
Error when converting a graphic to PDF |
64 |
Used graphic format is not supported |
66 |
Character width cannot be determined from the font data |
78 |
OS/2 2.x bitmap format is currently not supported |
92 |
Error in correct font formatting |
96 |
OS/2 driver structure contains no length specification |
99 |
Invalid property name |
100 |
Illegal property value |
102 |
Heap could not be created or activated |
103 |
Error during Zlib compression or decompression |
109 |
No output file specified |
117 |
Internet functions (wininet.dll) not found |
118 |
Directory error |
120 |
Cannot delete file |
121 |
File error |
122 |
Invalid license key |
128 |
Socket Error |
181 |
General Tiff error |
182 |
Invalid color depth for Tiff conversion |
185 |
Group3/4 and RLE compression only valid for 2 colours |
195 |
General Type1 Error |
198 |
Unexpected exception error occurred and caught |
199 |
The bar code statement contains an empty bar code value |
255 |
The document content does not fit into the defined Checkmask |
256 |
The document content does not fit into the defined font mask |
267 |
Output format does not support output to memory |
270 |
The OpenSSL library could not be found |
271 |
The certificate file could not be found |
272 |
The certificate file has an unsupported format |
273 |
The password for the certificate file is incorrect |
274 |
The certificate is not yet valid or has expired |
279 |
Generation of the DataMatrix barcode failed ( possibly too large data volume) |
297 |
Output format does not support output to memory |
300 |
General Pdf error |
301 |
Internal Pdf error (assertion) |
302 |
Error in PdfMerge |
303 |
Error in PdfConcat |
304 |
Error with PdfPrint |
305 |
General error when generating the Pdf signature |
306 |
The OpenSSL library could not be found |
307 |
The certificate file could not be found |
308 |
The certificate file has an unsupported format |
309 |
The password for the certificate file is incorrect |
310 |
Error accessing data (csv,xml,xfdf) |
311 |
Document could not be web optimized |
312 |
Document could not be parsed |
313 |
Error when accessing a dll |
314 |
Error in the CibDataXml or CibDataCsv |
315 |
Data access type is not supported |
316 |
Incompatible data access-dll |
317 |
Record could not be read |
318 |
Record could not be read: syntax error |
319 |
xml-query returns no data |
320 |
Error accessing cibcache.dll |
321 |
Form field is not included in the Pdf |
322 |
Form field value cannot be set |
323 |
Pdf object cannot be updated |
324 |
Pdf is encrypted and the password you have received is not correct or empty |
325 |
Field value properties do not match the input file |
326 |
Owner password (master password) required |
327 |
Insufficient rights |
328 |
Owner password (main password) invalid |
329 |
Incompatible Acroforms |
330 |
Signature could not be verified |
331 |
The certificate is not yet valid or has expired |
332 |
The certificate chain is invalid |
333 |
The certificate is not trustworthy |
334 |
General error when validating Pdf signatures |
335 |
The signature has an incorrect or unsupported format |
336 |
The CIB ocr library could not be found |
337 |
General error in the CIB ocr library |
338 |
Required data for the CIB ocr library could not be found |
|
|
340 |
General JBIG2 error |
341 |
Unexpected exception in JBIG2 module |
342 |
JBIG2 module could not be loaded |
343 |
Error when reading the JBIG2 data |
344 |
Error when decompressing a JBIG2 image |
345 |
Error when compressing a JBIG2 image |
346 |
Cannot be converted to PDF/A (for various reasons) |
347 |
Transparency was used in PDF, cannot be converted to PDF/A |
348 |
Both RGB and CMYK color spaces were used, cannot be converted to PDF/A |
349 |
The 'OutlinesAdd' property has an incorrect format |
350 |
System error: A temporary font file could not be installed |
351 |
Optional Content Group (OCG) was used in PDF, cannot be converted to PDF/A |
352 |
Problem with embedded font in PDF, cannot be converted to PDF/A |
353 |
Dictionary has more than 4095 entries, cannot be converted to PDF/A |
354 |
The specified PDF/A profile is not supported in this version, cannot be converted to PDF/A |
355 |
The ZUGFeRD Xml does not correspond to the given scheme |
356 |
The page selection did not find any matching pages |
357 |
The ZUGFeRD Xml has an incorrect format |
358 |
The PDF does not conform to the PDF/A3 standard, but a PDF/A3 is necessary to embed a ZUGFeRD xml correctly |
359 |
A ZUGFeRD XML is already embedded |
|
|
361 |
No CIB renderer library was found |
362 |
Error loading the CIB renderer, a wrong version of the CIB renderer was found |
363 |
DocMDP Signature only possible from PDF-1.5 |
364 |
Rendering of the document failed |
365 |
This operating system version is not supported by the CIB renderer |
366 |
A page specified in property BackgroundFilename was not added |
367 |
Error during PDF/A conversion: Embedded files are not allowed |
368 |
Error during PDF/A conversion: Password is not allowed |
369 |
Rendering of documents with XFA forms is not supported |
370 |
Temporary path does not exist |
371 |
Error during execution of the CIB pdfModule |
953 |
The image file cannot be loaded from the memory address |
1000 |
Userbreak2 |
20. Trace
For unclear error situations you have 2 possibilities to create an additional log file:
- You set the environment variable CIB_PDFTRACE to a file name and execute the process.
- You set the property "Tracefilename" and carry out the process.