Skip to main content
Participant
September 19, 2018
Answered

Auto detect input fields in a flat PDF via the SDK. Is this possible?

  • September 19, 2018
  • 2 replies
  • 7433 views

I have a flat PDF (no Acroform fields). Just a flat PDF. Is it possible, via the API, to get a list of possible input fields? (Text fields, check boxes, etc.) This is what I want, only delivered via an API call (see link->):  Automatic Field Detection in Authoring

If the Adobe SDK does not do this, does anyone know of any API that does something like this?

This topic has been closed for replies.
Correct answer Thom Parker

I was laughing at Bernd's casual suggestion for writing a field detection plug-in. This is not a trivial task.  It's the kind of thing you build an AI for.

However, what you are asking for is a PDF library or Tool for building an external application.  There are many PDF libraries and single function development tools. I am not aware of any that do auto-form field detection, although it wouldn't surprise me if there were some out there. For example I just did a google search on "Auto Detect PDF Form Fields".  The first page is all articles/forum threads about using Acrobat to autodetect fields, but at the bottom was this online tool for doing it.

Form Field Detector - Accusoft

It looks like an online service you can connect to from your own HTML page using JS.

Also, I haven't checked but I maybe this capability is avaliable from the official PDF Library, distributed by DataLogics:

https://www.datalogics.com/products/pdf/pdflibrary/

And it is in C++.  You'll find many of the PDF tools and libraries are Java and .Net 

2 replies

Bernd Alheit
Community Expert
Community Expert
September 19, 2018

You can create your own plugin for this.

Thom Parker
Community Expert
Community Expert
September 19, 2018

Ha Ha  

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Thom Parker
Community Expert
Community Expert
September 19, 2018

Depends.  If you mean the JavaScript API, then no, there is not really any way to access the Form field detection feature. This is a built in Adobe specific thing that they control. It's not part of the general PDF operation included in either the JS or plug-in SDK.

However, there are hooks into this functionality that provide some access. For example, this feature is a command on the "Action" editor. So it can be used in an Action, which is a type of automation.  Action commands can also be activated from a plug-in, but the plug-in doesn't have any control over how the field detection proceeds, it's just like running a menu item.  You can execute it, but then Acrobat does what it does, including any popup dialogs and messages that the user has to respond too.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
September 19, 2018

Maybe I'm in the wrong area? I don't want a plugin or a menu item. I want to call a function from C++ (or C#) code. Acrobat will not be running.

I want to load a PDF and detect all possible input text fields on the page. Example:

  myApi->LoadPDF("pdfDocument.pdf")

  CString xmlString = GetAllPossibleInputFields();

Where an input field is NOT an acroform field, but rather a PROBABLE input field based on OCR intelligence.

Thanks.

Glad my question was a good for a laugh!

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
September 19, 2018

I was laughing at Bernd's casual suggestion for writing a field detection plug-in. This is not a trivial task.  It's the kind of thing you build an AI for.

However, what you are asking for is a PDF library or Tool for building an external application.  There are many PDF libraries and single function development tools. I am not aware of any that do auto-form field detection, although it wouldn't surprise me if there were some out there. For example I just did a google search on "Auto Detect PDF Form Fields".  The first page is all articles/forum threads about using Acrobat to autodetect fields, but at the bottom was this online tool for doing it.

Form Field Detector - Accusoft

It looks like an online service you can connect to from your own HTML page using JS.

Also, I haven't checked but I maybe this capability is avaliable from the official PDF Library, distributed by DataLogics:

https://www.datalogics.com/products/pdf/pdflibrary/

And it is in C++.  You'll find many of the PDF tools and libraries are Java and .Net 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often