The PDF Document Processing section provides functions for working with PDF documents.
It includes operations such as form handling, metadata retrieval, and other document-level processing tasks.
These APIs enable inspection, preparation, and manipulation of PDF documents within the application.
formPdf (Android, iOS) #
Updates the AcroForm fields of the specified PDF using values provided in a JSON object.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the pdf were successfully updated, false otherwise.
*/
function formPdf (arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| file | true | string | Path to the target PDF file within the workspace. |
| data | true | JSON Object | Value pairs must match the names of the corresponding AcroForm fields |
| csv | false | string | Path to the target file within the workspace. Can be used to save an additional copy of the field values as a CSV (Comma-Separated Values) file |
| flatten | false | boolean | If true, fields will be flattened after AcroForm fields update. Default false |
Example :
const arg = {
"file": "/tosign/Test1.pdf",
"data" : {
"TC_text" : "Some text",
"CR_checkbox" : "Yes",
"RO_radio" : "B"
},
"csv" : "/csv/Test1.csv",
"flatten" : false
}
const isSuccess = formPdf(arg);mergePdf (Android) #
Combines multiple PDF documents into a single PDF for signing. This can be used when individual documents do not need to be signed separately, allowing all documents to be signed in one step and reducing both the number of signatures and the overall signing time.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the PDF were successfully merged, false otherwise.
*/
function mergePdf(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| file | true | string | Path to the final PDF file within the workspace. |
| list | true | JSON Array | JSON Array of JSON Objects |
| list.path | true | string | Path to the PDF file within the workspace. |
| list.order | true | int | Order in final pdf |
Example :
const arg = {
"file": "/new/Final.pdf",
"list": [
{
"path": "/pdf/Test1.pdf",
"order": 1
},
{
"path": "/pdf/Test2.pdf",
"order": 2
}
]
};
const isSuccess = mergePdf(arg);addJpgToPdf (Android) #
Adds one or more images to the end of a PDF document. The images are placed on a new page that becomes the document’s last page. Up to two images can be placed on a single page.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the images were successfully added, false otherwise.
*/
function addJpgToPdf(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| file | true | string | path to the target PDF file within the workspace. |
| list | true | JSON Array | JSON Array of JSON Objects with image paths |
| list.path | true | string | Path to the image file within the workspace |
Example :
const arg = {
"file": "/pdf/Test1.pdf",
"list": [
{
"path": "/img/image1.jpg"
},
{
"path": "/img/image2.jpg"
}
]
};
const isSuccess = addJpgToPdf(arg);jpgToPdf (Android) #
Creates a new PDF file with one JPG image per page where JPG images come from a list of existing files. Returns true if successful.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the PDF were successfully created, false otherwise.
*/
function jpgToPdf(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| file | true | string | Path to the target PDF file within the workspace. |
| list | true | JSON Array | JSON Array of JSON Objects with image paths |
| list.path | true | string | Path to the image file within the workspace |
Example :
const arg = {
"file": "/new/Test1.pdf",
"list": [
{
"path": "/img/image1.jpg"
},
{
"path": "/img/image2.jpg"
}
]
};
const isSuccess = jpgToPdf(arg);Note: The file list can be obtained as output of function ‚dirlist()‘
loadAcroformData (Android, iOS) #
Converts the information from all Acroform fields of a PDF document to a JSON structure suitable for editing the information in a SIGNATUS form.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {string} - Returns PDF acroform data in JSON format as string
*/
function loadAcroformData (arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| file | true | string | Path to the target PDF file within the workspace. |
Example :
const arg = {
"file": "/tosign/Test1.pdf"
}
const res = loadAcroformData (arg);
const result = JSON.parse(res);Result example :
{
"CR_checkbox": "Off",
"CO_checkbox": "Yes",
"RO_radio": "Off",
"DW_text": "01.12.2025",
"SC_signature": "",
"CBO_combo": "A",
"TO_text": "",
"TC_text": "",
"TOA_text": "Value1",
"SO_signature": ""
}getPdfInfo (Android) #
Returns metadata from a PDF file downloaded to the device through the wizard, such as Author, Title, Subject, and Keywords. This information is read from the corresponding metadata fields within the PDF and can be used later during the wizard workflow.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {string} - Returns PDF info data in JSON format as string
*/
function getPDFInfo (arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| path | true | string | path to the target PDF file within the workspace. |
| values | true | JSON Array | JSON Array with keywords names |
Example :
const arg = {
"path": "/tosign/Test1.pdf",
"values": ["Author", "Title"]
}
const res = getPdfInfo(arg);
const result = JSON.parse(res);Result example :
{
"Author": "John Doe",
"Title": "PDF for testing"
}