signdoc/convert


Overview

URLhttps://<signdoc-baseurl>/signdoc/convert
AuthorizationAccess Token as Bearer Token in Authorization Header



Get supported PDF conversions

GET [signdoc-baseurl]/signdoc/convert/pdf/specs

Request

Headers

Key

Value

Content-Type

application/json

Example request

GET [signdoc-baseurl]/signdoc/convert/pdf/specs

Response

CodeDescriptionExample JSON response content
200 OKList of currently supported PDF conversions.

{

  "pdfSpecs": [ "PDFA_2B" ]

}

Convert PDF documents

POST [signdoc-baseurl]/signdoc/convert/pdf

Request

Headers

Key

Value

Authorization

Bearer access_token

Content-Type

application/json

Request body

Key

Type / Description

Example JSON

documents

JSON array of documents to be signed (minimum one).

The document to be signed is represented as a JSON object:

key

type

description

default value

pdfSpec

string

Validates and if necessary converts the document (pdf) to specified PDF/A version and conformance level.

Currently only PDFA_2B is currently supported and conversion is only active in production.

(required)

pdf

string

Base64 encoded PDF

(required)




"documents": [
{
    "pdfSpec:" "PDFA_2B",
"pdf": "JVBER..."
}
]

Example request

POST [signdoc-baseurl]/signdoc/convert/pdf
Request body:
{
"documents": [
{
           "pdfSpec:" "PDFA_2B",
"pdf": "JVBER..."
{
           "pdfSpec:" "PDFA_2B",
           "pdf": "JVBER..."
}
]
}

Response

Content-Type: application/json


Code

Description

Example JSON response content

200 OK

Successfully uploaded and converted document

conversionWarnings contains an array of warnings that occurred during the conversion.

Possible values are:

  •     VISUAL_DIFF("Visual differences in output PDF")
  •     COLORANTS("Resolve name collisions of colorants")
  •     OCG_REMOVED("Removed optional content groups (layers)")
  •     TRANSP_REMOVED("Transparency removed")
  •     XMP_REMOVED("Removed non convertible XMP metadata")
  •     FONT_SUBST("Font substituted")
  •     ACTION_REMOVED( "Removed interactive elements such as actions or annotations")
  •     STRUCTURE_REMOVED("Structure removed")


In CURRENT the response will always be DISABLED("PDF conversion is disabled") and  "converted" = false

{
  "conversionResults": [
        {
            "conversionId": "d886b218-af9f-4765-a9e1-d819fec6abbe",
            "description": "My order name - 1",
            "converted": true,
            "conversionErrors": [],
            "conversionWarnings": [
                "Visual differences in output PDF",
                "Removed interactive elements such as actions or annotations"
            ]
        },
"convertedDocument": "JVBERi0xLjcKJ"
        {
            "conversionId": "1b4c673a-9d9e-4680-8aa2-810a31d50d8c",
            "description": "My order name - 2",
            "converted": true,
            "conversionErrors": [],
            "conversionWarnings": [
                "Visual differences in output PDF",
                "Removed interactive elements such as actions or annotations"
            ]
      },
"convertedDocument": "JVBERi0xLjcKJ"
    ]
}

400 Bad request

Could not convert order due to error in request. 

Documents that could not be converted will have a list of errors in  conversionErrors.

Possible conversionErrors are:

  • CORRUPT("Document is corrupt")
  • DOC_SIGNED("Document contains signatures")
  • EF_REMOVED("Embedded files removed")
  • GENERIC_ERROR("Unknown error")
  • DISABLED("PDF conversion is disabled") 



{
    "conversionResults": [
        {
            "conversionId": "90c3803b-5e90-400c-b945-02ce223d65be",
            "description": null,
            "converted": true,
            "conversionErrors": [],
            "conversionWarnings": [
                "Visual differences in output PDF",
                "Removed interactive elements such as actions or annotations"
            ]
        },
        {
            "conversionId": "fe7c3db8-e586-4253-960b-771ba6d170a1",
            "description": null,
            "converted": true,
            "conversionErrors": [],
            "conversionWarnings": [
                "Visual differences in output PDF",
                "Removed interactive elements such as actions or annotations"
            ]
        },
        {
            "conversionId": "d796513c-ae65-4a9b-a3ae-f6652d4f7a2b",
            "description": null,
            "converted": false,
            "conversionErrors": [
                "Document contains signatures"
            ],
            "conversionWarnings": []
        }
    ]
}

403 Forbidden

Access token is invalid.

AccessToken is invalid - Please provide reference: AbcDEf if reporting the problem.