PDF Visa Upload and Processing
TrustX provides functionality to upload a Visa document as a PDF file and have those documents processed using the ID Document processor. This provides the same flexibility as a standard document capture process where details may be extracted and used as part of a Process Definition and viewed within the Backoffice as any normal captured document.
This guide will describe a use case where a Visa is uploaded as a PDF file via the Backoffice Process Designer using the supported 'PDF ID Upload v1' activity and 'ID Document Processor 8.2' activities.
This functionality is in Early Access and is currently limited to a subset of Visa documents that have been tested for compatibility:
- Chinese Visa Document
- Brazilian Visa Document
Configure the Custom Page
Before configuring the Process Definition, a Custom Page will be created that will be used to handle request the end-user to upload a PDF file of the Visa document.
- In the Backoffice application, navigate to Integration Hub > Custom Pages using the right-side vertical navigation menu.
- From the Custom Pages landing page, click the 'New Custom Page' button.
- Upload the Zip bundle containing all assets of the Custom Page. Below is an example Custom Page that includes a HTML and Javascript file.
Example index.html:
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title></title>
<link
href="https://fonts.googleapis.com/css?family=Lato:300,400|Montserrat:700"
rel="stylesheet"
type="text/css"
/>
<style>
@import url(//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css);
@import url(//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css);
</style>
<link
rel="stylesheet"
href="https://2-22-4-dot-lead-pages.appspot.com/static/lp918/min/default_thank_you.css"
/>
<script src="https://2-22-4-dot-lead-pages.appspot.com/static/lp918/min/jquery-1.9.1.min.js"></script>
<script src="https://2-22-4-dot-lead-pages.appspot.com/static/lp918/min/html5shiv.js"></script>
</head>
<body>
<div id="page1">
<header class="site-header" id="header">
<h1 class="site-header__title" data-lead-id="site-header-title">
Document Capture
</h1>
</header>
<div class="main-content">
<input type="file" id="fileInput" />
<br />
<br />
<br />
</div>
<footer class="site-footer" id="footer">
<p class="site-footer__fineprint" id="fineprint">
Copyright ©2025 | All Rights Reserved
</p>
</footer>
</div>
<script src="./index.js"></script>
</body>
</html>
Example Javascript:
var _presignedUrl;
var _headers;
var url =
"https://sky-dev-oak-data-eu-west-1.s3.eu-west-1.amazonaws.com/tenants/skydev1/processDefinitions/ZTR76WT6MJNX6PZFEPZZI5B6KI/processInstances/GRJLKKQZUWOMTWP7NXODE5OZHU/idDocs/doc1/307fbf0f-ba1f-4d34-8019-28ab10920d00/2a69583b-cb17-49e0-8698-d6f346b88ca4/FRONT.Uncropped.id.bin?X-Amz-Security-...";
window.parent.postMessage({ event: "READY" }, "*");
document
.getElementById("fileInput")
.addEventListener("change", async function (event) {
const file = event.target.files[0];
if (!file || !url) return;
console.log("uploading to: ", _presignedUrl);
try {
const response = await fetch(_presignedUrl, {
method: "PUT",
headers: {
"x-amz-tagging": _headers["x-amz-tagging"],
"x-amz-server-side-encryption-aws-kms-key-id": _headers["x-amz-server-side-encryption-aws-kms-key-id"],
"Content-Type": "application/pdf",
"x-amz-server-side-encryption": "aws:kms",
},
body: file,
});
if (!response.ok) {
const errorText = await response.text(); // Read the error response
console.error("Upload failed:", response.status, response.statusText, errorText);
alert(`Upload failed: ${response.status} ${response.statusText}`);
}
console.log("Upload successful:", response);
window.parent.postMessage(
{ event: "SEND", variables: { message: "Success" } },
"*"
);
} catch (error) {
console.error("Error uploading file:", error);
}
});
window.addEventListener("message", function (event) {
console.log("Received message from parent:", event.data.variables);
_presignedUrl = event.data.variables.sessionData.uploadURL;
_headers = event.data.variables.sessionData.uploadURL_headers;
});
- From the example above, the variable
_presignedUrl
and_headers
contain the Output Variable from the PDF ID Upload v1 activity. These values will be configured in the Custom Page activity. - Once the Custom Page is configured, click 'Save & Deploy'.
Configure the Process Definition
The Process Definition in this example describes a simple PDF upload flow where a Visa document is uploaded and processed by the ID Document Processor (v8.2).
- Create a new Process Definition by navigating to the Process Definitions page found on the vertical menu of the Backoffice.
- Click the 'New Process Definition' button on the top right of the Process Definitions landing page.
- Add a Start event to the Process Definition using the 'Create Start Event' option from the Process Designer pallet.
- Add a 'Define Document Type V1' activity to the designer and connect it to the Start event. This activity will set the document type of the ID document that will be uploaded during the process. It contains the following input parameters:
Parameter Name | Type | Description |
---|---|---|
Acceptable Countries | list[string] | A list of accepted countries. |
Country Code | string | The two-letter country code of the document. |
Document Key | string | The two-letter country code of the document. |
Document Type | string | The accepted document type. |
- Add a 'PDF ID Upload v1' activity to the designer and connect it to the 'Define Document Type V1' activity using a sequence flow arrow. This activity will enable TrustX to handle the upload of a PDF file as an ID document. This activity features the following configurable input parameters:
Parameter Name | Type | Description |
---|---|---|
Document Key | string | the unique ID of the document. This should match the Document Key defined in the 'Define Document Type V1' activity. |
Format | string | The format of the file that will be uploaded. Currently only PDF is supported. |
Output Variable | string | The Output Variable will provide a URL that can be used to upload the PDF document. This is used in the Custom Page url variable defined in the Configure the Custom Page section above. |
Add a 'Custom Page V3' activity to the Process Designer and connect to the 'PDF ID Upload v1' activity. This activity will be configured to show the Custom Page defined in the Configure the Custom Page section above.
On the 'Custom Page V3' activity, configure the following input parameters by selecting the activity in the designer:
- Custom Page Name - The name of the Custom Page defined in the section above.
- Session Data - Session Data variables that will be sent to the Custom Page:
- (key: uploadURL, value: ${uploadURL})
- (key: uploadURL_headers, value: ${uploadURL_headers})
Add an 'ID Document Processor 8.2' activity to the designer and connect it to the 'Extract PDF Page v1' activity using a sequence flow arrow. This activity supports the following configurable input parameters:
Parameter | Description | Type | Default |
---|---|---|---|
Already Cropped | When enabled, will signal to the document processer that the document image is already cropped. NOTE: For PDF upload, this parameter must be set to `${true}` | boolean | false |
Document Key | The identifier of the document. | string | doc1 |
Error navigation screen | The screen the user will be navigated to in case of an error event occurs. | string | instructions |
Exception Max Attempts | Exception for max attempts. | string | ${true} |
Fields to assign original values | Enables customers to define a list of original values to be returned by the processor. | list[string] | |
Image Profile | The profile of the image; Cropped or Uncropped. | string | Cropped |
Max Attempts | The maximum number of allowed attempts. | integer | ${3} |
Measure System | The unit of measurement to be used. Possible values are METRIC or IMPERIAL. | string | METRIC |
Original Response Enabled | If set to true, the response of additional checks will be returned (eg. Chip data). If false, additional checks will not be returned. | string | ${false} |
Scenario | Set the type of security check to perform where FullAuth will perform additional security checks. Possible values include FullAuth, FullProcess or DocType. | string | ${FullProcess} |
- Once configured, add a 'Create End Event' to the designer and connect the 'ID Document Processor 8.2' activity using a sequence flow arrow. This will conclude the
- The completed Process Definition will appear as follows:

- Once all the configurations are finalized, click the 'Save & Deploy' button to complete the Process Definition.
Testing the Process Definition
The Process Definition can be tested by creating a Process Token in the Backoffice application.
- From the Backoffice, find Process Definitions > Process Tokens.
- From the Process Tokens landing page, click the 'New Process Token' button.
- A pop-up will appear where details such as the Process Definition, Process Token Name, and Additional Parameters can be defined.

- Once all details are defined, click the 'Create Token' button.
- Open the token URL to start the process. This will present the end-user with a Custom Page where a PDF file containing a scan of an ID document can be presented.
