How to check a PDF integrity?

It happens that we process malformed PDFs that can’t be opened even with Acrobat.

Is there a way to check if a PDF:

  • is not corrupted, can be opened
  • adheres to the PDF spec, not necessarily PDF\A or others but if the PDF is “well built”

Are there external tools\executables that suggested and easy to integrate with a Workflow process using the run program step?

A simple script in Workflow will allow you to validate the PDF:

var myPDF = Watch.GetPDFEditObject();
try {
  myPDF.Open(Watch.GetJobFileName(),true);
  Watch.Log("PDF is valid",2)
  myPDF.Close();
} catch (e) {
  Watch.Log("PDF is invalid",2);
}
1 Like