Loading...

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Use this code to programmatically determine if a PDF document is an AcroForm:


bool hasAcroFormFields = false;
if(doc.Root.Contains("AcroForm"))
{
var AcroFormDict = doc.Root.Get("AcroForm") as PDFDict;
hasAcroFormFields = AcroFormDict.Contains("Fields") && (AcroFormDict.Get("Fields") as PDFArray).Length > 0;
}
if (hasAcroFormFields)
Console.WriteLine("Has AcroForm Fields: {0}", filename);


This code identifies the API calls that you can use to detect an AcroForm PDF document. It is not designed to detect XFA forms, If you need to be able to detect XFA forms as well, please contact your Datalogics Support representative.