Page 1 of 1

Form-Fillable PDF: Number of Fields?

Posted: 16 Mar 2018, 14:59
by MaxAstro
Is there a way to determine the number of fields in a form-fillable PDF in Adobe Acrobat?

At my work use a series of PDFs for the sale signs that we make. Some are 8 signs per page, some 12, and some 16. I'm trying to figure out a way to programmatically detect what size signs are currently open in Acrobat without having to rely on gimmicks like checking the file name.

Re: Form-Fillable PDF: Number of Fields?

Posted: 16 Mar 2018, 16:40
by FanaticGuru
MaxAstro wrote:Is there a way to determine the number of fields in a form-fillable PDF in Adobe Acrobat?

At my work use a series of PDFs for the sale signs that we make. Some are 8 signs per page, some 12, and some 16. I'm trying to figure out a way to programmatically detect what size signs are currently open in Acrobat without having to rely on gimmicks like checking the file name.
This will tell you the number of fields in the active PDF open in Adobe Acrobat.

Code: Select all

F12::
	AFormAut := ComObjCreate("AFormAut.App")
	MsgBox % AFormAut.Fields.Count
return
FG

Re: Form-Fillable PDF: Number of Fields?

Posted: 19 Mar 2018, 08:49
by MaxAstro
FanaticGuru wrote:This will tell you the number of fields in the active PDF open in Adobe Acrobat.

Code: Select all

F12::
	AFormAut := ComObjCreate("AFormAut.App")
	MsgBox % AFormAut.Fields.Count
return
FG
When I run that script, I get the error "Class not registered".

Re: Form-Fillable PDF: Number of Fields?

Posted: 19 Mar 2018, 11:20
by burque505
MaxAstro, I get the same problem if I run it from Scite4AHK. But if I double-click in Explorer to run it, it works fine. The Internal AHK gives me problems with many COM objects.
By the way, it needs Acrobat itself to be open, I believe, not FormsCentral.
Regards,
burque505

Re: Form-Fillable PDF: Number of Fields?

Posted: 19 Mar 2018, 13:09
by FanaticGuru
MaxAstro wrote:When I run that script, I get the error "Class not registered".
That is the error I would expect if the hotkey was run without a PDF open in the full version of Adobe Acrobat. Will not work with Acrobat Reader or other free PDF viewers.

Also as mentioned running scripts through Scite4AHK can sometimes cause problems. The script works running through Scite4AHK for me but sometimes depending on your setup Scite4AHK can cause permission problems.

FG

Re: Form-Fillable PDF: Number of Fields?

Posted: 19 Mar 2018, 15:08
by MaxAstro
Ah, I see the problem - I need it to work from Reader.

That's okay, I was able to do some magic with GDIP image search to get the information I needed another way.

Re: Form-Fillable PDF: Number of Fields?

Posted: 19 Mar 2018, 15:48
by jeeswg
Acc might work. If someone has a link to such a pdf, I could do some tests myself.
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201