sign pro PDF API Demo app for Android
sign pro PDF for Android can be called from another app along with some JSON parameters to automate operations.
JSON format
File
Users can specify HTTP or Filesystem.
Input
Key | Example Value | Type | Description |
---|---|---|---|
filesytem | content://com.android.providers.downloads.documents/document/16 | String | URI string to PDF to open |
http_get | http://pdf_server.com/pdfs/test.pdf | String | Absolute URL to an http server providing PDFs via GET |
It is mandatory to add a valid input value.
Output
Key | Example Value | Type | Description |
---|---|---|---|
filesytem | content://com.android.providers.downloads.documents/document/16 | String | URI string to a document in which the PDF will be saved. |
http_post | http://pdf_server.com/pdfs/test.pdf | String | Absolute URL to an http server receiving the PDF vida POST (PDF as body). |
It is not mandatory to define an output value. In case the output value is not defined, sign pro PDF will ask for a valid URL to save when closing.
"Select an output file from sign pro PDF app"
Authentication
Key | Example Value | Type | Description |
---|---|---|---|
pdf_user_password | pass123 | String | User password for opening a PDF. This is applied when opening password-protected PDFs. |
http_user | user | String | HTTP Basic Authentication Username. |
http_pass | pass456 | String | HTTP Basic Authentication Password. |
Configuration
Key | Example Value | Type | Description |
---|---|---|---|
show_annotate | true | Boolean | Allow freehand annotation on the document. |
show_manual_signature | false | Boolean | Allow manual placement of signature fields (i.e. no predefined fields are present and none are added via the API). |
process_text_tags | true | Boolean | Specify whether embedded Text Tags should be processed or not. If true, Signatures and Initials provided by the API will be ignored. |
Signatures
Array of signatures to pre-define in the document.
Signature
Key | Example Value | Type | Description |
---|---|---|---|
name | Signature_1 | String | Name of signature field (must be unique). |
signer | John Smith | String | Signatory Name. |
reason | Agreement | String | Signatory Reason. |
biometric | true | Boolean | Specify if the signature requires biometric data. In this case, only signing with stylus will be allowed. |
required | false | Boolean | Specify whether completion of this signature is required before the document can be completed. |
location | ... | Location | See Location table below. |
image | ... | Image | See Image table below. |
certificate | ... | Certificate | See Certificate table below. |
Initials
Array of initials to pre-define in the document.
Initial
Key | Example Value | Type | Description |
---|---|---|---|
name | Initial_1 | String | Name of initial field (must be unique). |
signer | John Smith | String | Signatory Name. |
reason | Agreement | String | Signatory Reason. |
biometric | true | Boolean | Specify if the signature requires biometric data. In this case only signing with stylus will be allowed. |
required | false | Boolean | Specify whether completion of this signature is required before the document can be completed. |
location | ... | Location | See Location table below. |
image | ... | Image | See Image table below. |
certificate | ... | Certificate | See Certificate table below. |
Location
Key | Example Value | Type | Description |
---|---|---|---|
Page | 1:2:3 1-7 1:2:5-9 | String | Defines which Page(s) the object should exist on. Can define ranges eg "1-3" or individual pages eg "1:3:5:7". If Location is set but Page is not, Object will repeat on every page. |
X | 234 | Int | Horizontal coordinate for Object origin. In default PDF units, from left. |
Y | 22 | Int | Vertical coordinate for Object origin. In default PDF units, from bottom. |
W | 200 | Int | Width of Object, in default PDF units. |
H | 50 | Int | Height of Object, in default PDF units. |
Image
An image can be assigned for the signature. Instead of capturing handwritten data, the image will be used.
Key | Example Value | Type | Description |
---|---|---|---|
file_path | content://com.android.providers.downloads.documents/document/16 | String | URI to the image to be used as signature. |
width | 234 | Int | Width of the image. |
height | 200 | Int | Height of the image. |
Certificate
A certificate in pkcs12 format can be defined in order to sign a determinate signature. If a certificate is not defined, the certificate selected in the sign pro PDF app will be used.
Key | Example Value | Type | Description |
---|---|---|---|
keystore_path | content://com.android.providers.downloads.documents/document/16 | String | URI to the certificate to be used |
keystore_password | 123456 | String | Password of the certifcate |
Text Fields
Array of text fields to pre-define within a given document.
Text
Key | Example Value | Type | Description |
---|---|---|---|
name | text_1 | String | Name of text field (must be unique) |
value | John Smith | String | Pre-filled default value of text field |
location | ... | Location | See Location table |
Checkboxes
Array of checkboxes to pre-define within a given document.
Checkbox
Key | Example Value | Type | Description |
---|---|---|---|
name | checkbox_1 | String | Name of checkbox field (must be unique) |
value | true | Boolean | true or false, whether the box should be checked by default |
location | ... | Location | See Location table |
{
"file": {
"input": {
"filesystem": "content://com.android.providers.downloads.documents/document/msf%3A52"
},
"output": {
"filesystem": "content://com.android.providers.downloads.documents/document/msf%3A53"
},
"authentication": {
"pdf_user_password": "pass",
"http_user": null,
"http_password": null
}
},
"configuration": {
"show_annotate": false,
"show_manual_signature": false,
"process_text_tags": false
},
"signatures": [
{
"name":"signature_1",
"signer":"John Smith",
"reason":"Agreement",
"biometric": true,
"required": true,
"location" : {
"Page": "1",
"X": 123,
"Y": 456,
"W": 50,
"H": 200
}
},
{
"name":"s2",
"signer":"John Smith",
"reason":"Agreement",
"biometric": true,
"required": false,
"location" : {
"Page": "1",
"X": 175,
"Y": 450,
"W": 200,
"H": 260
}
}],
"textfields":[
{
"name":"text1",
"location":{
"Page":"1",
"X":200,
"Y":600,
"W":150,
"H":44
}
},
{
"name":"text2",
"value":"testing",
"location":{
"Page":"3",
"X":200,
"Y":600,
"W":150,
"H":44
}
}],
"initials": null
}
Text Tag
When opened via the API, documents containing embedded Text Tags adhering to the schema will be processed and the resulting objects placed according to their text position.
- TextTags must be enclosed with
{{[[
and]]}}
. - There must be no spaces between Keys.
- Tags can be as small as the PDF creator will allow, or the same color as the background, but they must exist in the main body of the document, and not in annotations, sticky notes, form fields etc.
Default
All Tags have these features. Even if not defined below, the tag should have these features.
Key | Optional | Description | Example | |
---|---|---|---|---|
Type | No | Defines the tag. Each has a specific name. | Type=Signature | |
Name | No | The Name of the tag for IDML. For tags that occur on multiple pages, an integer is appended for each page it occurs on. Ex. ApprovalSignature1,ApprovalSignature2,... | Name=ApprovalSignature | |
Required | Yes | Boolean that states whether filling this field is required to finalize the document. 'true' or 'false' MUST be lowercase. Checkboxes cannot be marked required. | See Location table | Type=Signature,Name=ApprovalSignature,Required=true |
X | Yes | Define the horizontal location of the converted object. In PDF Units, Left Origin. If this is not set, the location of the TextTag itself will be used. | X=350 | |
Y | Yes | Define the vertical location of the converted object. In PDF Units, Bottom Origin. If this is not set, the location of the TextTag itself will be used. | Y=150 | |
Page | Yes | Defines which Page(s) the tag should exist on. Can define ranges eg "1-3" or individual pages eg "1:3:5:7". Page ranges must be enclosed in quotation marks "". Ignored if Location is not set. If Location is set but Page is not, Object will repeat on every page. | Page="1:2:3" Page="1-7" Page="1:2:5-9" | |
W | No | Defines the width of the control, if not set it will get a default size | W=250 | |
H | No | Defines the height of the control, if not set it will get a default size | H=72 |
Signature
The Signature Tag should be able to place a signature
Key | Optional | Description | Example |
---|---|---|---|
Type=Signature | No | Defines the Signature Tag | |
Signer | Yes | Defines the name of the signer. | Type=Signature,Signer=Aaron Johnson |
Reason | Yes | Defines the reason for signing. | Type=Signature,Reason=Approval |
Biometric | Yes | True/False whether Biometric metadata should be included in the document. | Type=Signature,Signer=Aaron Johnson,Biometric=False |
Here is a full example signature tag that might be inline in a PDF document.
{{[[Type=Signature,Name=ApprovalSignature,Signer=Aaron Johnson,Reason=Approval,Height=80,Width=250]]}}
Initial
The Initial Tag should be able to place an initials box.
Key | Optional | Description | Example |
---|---|---|---|
Type=Initial | No | Defines the Initial Tag | |
Signer | Yes | Defines the name of the signer. | Type=Initial,Signer=Aaron Johnson |
Reason | Yes | Defines the reason for signing. | Type=Initial,Reason=Approval |
Biometric | Yes | True/False whether Biometric metadata should be included in the document. | Type=Initial,Signer=Aaron Johnson,Biometric=False |
Here is a full example initial tag, to insert initials boxes in each bottom left corner 1" in.
{{[[Type=Initial,Name=InitialsTest,Signer=Aaron Johnson,Reason=Approval,X=72,Y=72,Height=60,Width=60]]}}
Text
Key | Optional | Description |
---|---|---|
Type=Text | No | Defines the TextTag |
Value | Yes | Populate the text field with a default text string. |
Example
{{[[Type=Text,Name=FirstName,Value=Chris,Width=200,Height=50]]}}
Checkbox
Key | Optional | Description |
---|---|---|
Type=Checkbox | No | Defines the TextTag |
Value | Yes | Select the checkbox by default. Acceptable values are 'true' or 'false' |
{{[[Type=Checkbox,Name=Primary,Value=true]]}}