PROCESIO
OverviewPlatform ActionsIntegrations & DemosMarketplaceCustom ActionsDeveloperโ€™s Guide

PDF Is Valid

Checks that a file is a PDF that can be opened, and returns true or false with the reason.

The Is Valid action in the PDF folder checks that a file is a real PDF that can be opened, for example before you merge it, extract its text or store it. Unlike the other Is Valid actions, it does not fail: it returns Validation Output (true or false) and, when the file is not valid, the reason.

Add the action

In the Process Designer toolbox, open PDF and pick Is Valid. The JSON, XML and HTML folders each have an action with the same name, so check the folder.

The PDF Is Valid action properties: Pdf File, Validation Output and Validation Reason

Inputs and outputs

FieldDirectionTypeRequiredWhat to put / what you get
Pdf FileInputFileYesThe file to check.
Validation OutputOutputBoolean (true/false)Notrue when the file is a PDF that opens correctly, false otherwise.
Validation ReasonOutputTextNoWhy the file is not valid. Empty when it is valid.

Example

Pdf FileValidation OutputValidation Reason
invoice.pdf, a normal PDFtrue(empty)
broken.pdf, a text file renamed to .pdffalsePdfSharpCore: The file is not a valid PDF document. ; UglyToad.PdfPig: Could not find the version header comment at the start of the document. ; iText.Kernel.Pdf: PDF header not found. ;
notes.txtfalseInput file extension should be '.pdf', found => .txt

Good to know

  • The file must have the .pdf extension and open correctly in three different PDF readers. If any of them fails, the result is false and Validation Reason lists each reader's message.
  • The step succeeds in every case. Branch on Validation Output with a Decisional action.

On this page