Skip to main content

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

KeyExample ValueTypeDescription
filesytemcontent://com.android.providers.downloads.documents/document/16StringURI string to PDF to open
http_gethttp://pdf_server.com/pdfs/test.pdfStringAbsolute URL to an http server providing PDFs via GET

It is mandatory to add a valid input value.

Output

KeyExample ValueTypeDescription
filesytemcontent://com.android.providers.downloads.documents/document/16StringURI string to a document in which the PDF will be saved.
http_posthttp://pdf_server.com/pdfs/test.pdfStringAbsolute 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 "Select an output file from sign pro PDF app"

Authentication

KeyExample ValueTypeDescription
pdf_user_passwordpass123StringUser password for opening a PDF. This is applied when opening password-protected PDFs.
http_useruserStringHTTP Basic Authentication Username.
http_passpass456StringHTTP Basic Authentication Password.

Configuration

KeyExample ValueTypeDescription
show_annotatetrueBooleanAllow freehand annotation on the document.
show_manual_signaturefalseBooleanAllow manual placement of signature fields (i.e. no predefined fields are present and none are added via the API).
process_text_tagstrueBooleanSpecify 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

KeyExample ValueTypeDescription
nameSignature_1StringName of signature field (must be unique).
signerJohn SmithStringSignatory Name.
reasonAgreementStringSignatory Reason.
biometrictrueBooleanSpecify if the signature requires biometric data. In this case, only signing with stylus will be allowed.
requiredfalseBooleanSpecify whether completion of this signature is required before the document can be completed.
location...LocationSee Location table below.
image...ImageSee Image table below.
certificate...CertificateSee Certificate table below.

Initials

Array of initials to pre-define in the document.

Initial

KeyExample ValueTypeDescription
nameInitial_1StringName of initial field (must be unique).
signerJohn SmithStringSignatory Name.
reasonAgreementStringSignatory Reason.
biometrictrueBooleanSpecify if the signature requires biometric data. In this case only signing with stylus will be allowed.
requiredfalseBooleanSpecify whether completion of this signature is required before the document can be completed.
location...LocationSee Location table below.
image...ImageSee Image table below.
certificate...CertificateSee Certificate table below.

Location

KeyExample ValueTypeDescription
Page1:2:3 1-7 1:2:5-9StringDefines 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.
X234IntHorizontal coordinate for Object origin. In default PDF units, from left.
Y22IntVertical coordinate for Object origin. In default PDF units, from bottom.
W200IntWidth of Object, in default PDF units.
H50IntHeight 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.

KeyExample ValueTypeDescription
file_pathcontent://com.android.providers.downloads.documents/document/16StringURI to the image to be used as signature.
width234IntWidth of the image.
height200IntHeight 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.

KeyExample ValueTypeDescription
keystore_pathcontent://com.android.providers.downloads.documents/document/16StringURI to the certificate to be used
keystore_password123456StringPassword of the certifcate

Text Fields

Array of text fields to pre-define within a given document.

Text

KeyExample ValueTypeDescription
nametext_1StringName of text field (must be unique)
valueJohn SmithStringPre-filled default value of text field
location...LocationSee Location table

Checkboxes

Array of checkboxes to pre-define within a given document.

Checkbox

KeyExample ValueTypeDescription
namecheckbox_1StringName of checkbox field (must be unique)
valuetrueBooleantrue or false, whether the box should be checked by default
location...LocationSee 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.

KeyOptionalDescriptionExample
TypeNoDefines the tag. Each has a specific name.Type=Signature
NameNoThe 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
RequiredYesBoolean 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 tableType=Signature,Name=ApprovalSignature,Required=true
XYesDefine 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
YYesDefine 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
PageYesDefines 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"
WNoDefines the width of the control, if not set it will get a default sizeW=250
HNoDefines the height of the control, if not set it will get a default sizeH=72

Signature

The Signature Tag should be able to place a signature

KeyOptionalDescriptionExample
Type=SignatureNoDefines the Signature Tag
SignerYesDefines the name of the signer.Type=Signature,Signer=Aaron Johnson
ReasonYesDefines the reason for signing.Type=Signature,Reason=Approval
BiometricYesTrue/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.

KeyOptionalDescriptionExample
Type=InitialNoDefines the Initial Tag
SignerYesDefines the name of the signer.Type=Initial,Signer=Aaron Johnson
ReasonYesDefines the reason for signing.Type=Initial,Reason=Approval
BiometricYesTrue/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

KeyOptionalDescription
Type=TextNoDefines the TextTag
ValueYesPopulate the text field with a default text string.

Example

{{[[Type=Text,Name=FirstName,Value=Chris,Width=200,Height=50]]}}

Checkbox

KeyOptionalDescription
Type=CheckboxNoDefines the TextTag
ValueYesSelect the checkbox by default. Acceptable values are 'true' or 'false'

{{[[Type=Checkbox,Name=Primary,Value=true]]}}