PDF validation

Validating PDFs

SWF can validate PDF's when they are uploaded to give users either a warning or refuse documents, depending on the configuration. To enable the validation functionality, set this is the root of your config.json file:

"signingOrders": {
  "disableDocumentChecks": false
}

This is also the default configuration so if you want to disable PDF validation, simply set disableDocumentChecks to true. When it is enabled, SWF will look for three kinds of properties in your documents:

  1. Locks
  2. Previously added signatures
  3. Signing page

Locks

PDFs can have different kinds of locks and, if enabled, SWF will check for known locks in the documents you upload. If a known lock is found and the PDF lock validation functionality is enabled, the PDF is refused and the user can not create an errand with that PDF. To continue with that document, remove the lock and upload again.

To decide what message should be shown if a lock is detected, update the following attribute in the PdfValidation.properties file that can be located in you overlay folder:

pdf-validation-locked=This will be shown if the PDF is locked. Include file name with %s

If a locked PDF is uploaded by disabling the disableDocumentChecks configuration, users will not be able to sign the document

Previously added signatures

This functionality will also check for previously added signatures. If any previously added signatures are found, a warning will be shown to the user to warn about moving forward with this particular document. The reason for this is that a small number of documents may contain issues, such as problems with certificate validation or implementation, that could prevent you from successfully signing the document. While this is uncommon, it can occasionally occur. However, the user can still decide to continue with the document since it is only a warning.

The property to control the warning messages can be found in the PdfValidation.properties file:

pdf-validation-signed=This message will show if the PDF is previously signed. Include file name with %s

Sign page

When a document has been signed and a visual trail page has been added, we can not be sure that we can add more signatures. To warn the user about this, we can show a warning message about this. To configure what messages to display to the user, use the PdfValidation.properties file with this configuration:

pdf-validation-sign-page=This is a message if a sign page has been found which can make it unable to sign with further signatures. Include file name with %s

SWF needs a restart when the PdfValidation.properties has changed

Controlling warnings

If the warnings from the PDF validation is seen as severe, administrators can choose to reject PDFs that generate warnings. To do this, we can use the following configuration, in the config.json:

"signingOrders": {
  "rejectInvalidPdfA": true
}

The rejectInvalidPdfA default to false.

Validating PDF flavours

The application can be configured to validate PDF/A conformance validation on PDF files, when a signing order is created. The purpose of this function is to warn the user if the uploaded file does not meet the standards required by organisation policy.

Configure the system by indicating what PDF/A flavours are allowed. If NO_FLAVOUR is configured, all PDF/A flavours will be accepted. If no flavour at all is configured, the validation is skipped.

Tag Description
NO_FLAVOUR All PDF/A flavours
PDFA_1_A  1a PDF Version 1 Level A
PDFA_1_B  1a PDF Version 1 Level B
PDFA_2_A 2a PDF Version 2 Level A
PDFA_2_B 2b PDF Version 2 Level B
PDFA_2_U 2u PDF Version 2 Level U
PDFA_3_A 3a PDF Version 3 Level A
PDFA_3_B 3b PDF Version 3 Level B
PDFA_3_U 3u PDF Version 3 Level U
PDFA_4 4 PDF Version 4
PDFA_4_F 4 PDF Version 4 Level F
PDFA_4_E 4 PDF Version 4 Level E
PDFUA_1 ua1 PDF Version 1
WCAG2_1 wcag PDF version 2.1

Example configuration to allow 1a PDF Version 1 Level A and 3a PDF Version 3 Level A

"usePdfAFlavours": ["PDFA_1_A", "PDFA_3_A"]

See reference

To control the message shown to the user, add this property to your PdfValidation.properties file:

pdf-a1a-validation-failed=Error message for if a document did not adhere to the flavours configured. Include file name with %s
pdf-a1a-validation-error=Error message for if a validation could not be conducted. Include file name with %s

The default behavior to warn the user can be changed to reject the invalid PDF and not allow the order to be created at all. This will disable the "Create" button in the final step and also present a red warning text if the PDF standard is not met.

To activate the function, add "rejectInvalidPdfA": true to the signingOrders section of the config.json.