Form-Fillable PDF: Number of Fields?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
MaxAstro
Posts: 557
Joined: 05 Oct 2016, 13:00

Form-Fillable PDF: Number of Fields?

16 Mar 2018, 14:59

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.
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: Form-Fillable PDF: Number of Fields?

16 Mar 2018, 16:40

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
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
MaxAstro
Posts: 557
Joined: 05 Oct 2016, 13:00

Re: Form-Fillable PDF: Number of Fields?

19 Mar 2018, 08:49

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".
burque505
Posts: 1732
Joined: 22 Jan 2017, 19:37

Re: Form-Fillable PDF: Number of Fields?

19 Mar 2018, 11:20

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
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: Form-Fillable PDF: Number of Fields?

19 Mar 2018, 13:09

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
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
MaxAstro
Posts: 557
Joined: 05 Oct 2016, 13:00

Re: Form-Fillable PDF: Number of Fields?

19 Mar 2018, 15:08

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.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Form-Fillable PDF: Number of Fields?

19 Mar 2018, 15:48

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
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Spawnova and 271 guests