Copy link to clipboard
Copied
Hello.
I'm trying to use OLE Automation for Acrobat Reader in my application on VFP. There are no problems anywhere, but I came across a question that I can not find the answer to: How do I programmatically get Acrobat Reader to enter the "Read Mode (Ctrl-H)" mode?
AdobeApp = createObject ('AcroExch.App')
AdobeDoc = createObject ('AcroExch.AVDoc')
AdobeDoc.open (AdobeFileName, '')
AdobeForm = createObject ('AFormAut.App')
AdobeFields = AdobeForm.fields
AdobeApp.Show
AdobeDoc.BringToFront ()
? go into Read Mode (Ctrl-H)
Thanked in advance for help
Copy link to clipboard
Copied
Hello.
I'm trying to use OLE Automation for Acrobat Reader in my application on VFP. There are no problems anywhere, but I came across a question that I can not find the answer to: How do I programmatically get Acrobat Reader to enter the "Read Mode (Ctrl-H)" mode?
AdobeApp = createObject ('AcroExch.App')
AdobeDoc = createObject ('AcroExch.AVDoc')
AdobeDoc.open (AdobeFileName, '')
AdobeForm = createObject ('AFormAut.App')
AdobeFields = AdobeForm.fields
AdobeApp.Show
AdobeDoc.BringToFront ()
? go into Read Mode (Ctrl-H)
Thanked in advance for help
Copy link to clipboard
Copied
Deployed using the JS Console Arcodat and the command app.listMenuItems ()
The result is a working code:
AdobeApp = createObject ('AcroExch.App')
AdobeDoc = createObject ('AcroExch.AVDoc')
AdobeDoc.open (AdobeFileName, '')
AdobeForm = createObject ('AFormAut.App')
AdobeFields = AdobeForm.fields
AdobeApp.Show
AdobeDoc.BringToFront ()
AdobeApp.MenuItemExecute ("ReadingMode")
Thanks to all.
Copy link to clipboard
Copied
It will not work with Acrobat Reader.
Copy link to clipboard
Copied
I debugged my application for two days.
AdobeApp.Show caused the launch of Acrobat Reader DC, everything was fine.
After I received a list of menu commands from the Acrobat js console, AdobeApp.Show began to call Acrobat. The default pdf-file handler is Acrobat Reader.
What could have happened?
Copy link to clipboard
Copied
Test it on a system with Acrobat Reader only.
Copy link to clipboard
Copied
I started it on a virtual machine where Acrobat is not installed, but Reader is present.
The application throws an error when running AdobeApp = createObject ('AcroExch.App').
Copy link to clipboard
Copied
Correct – because Reader doesn’t expose that object.
Copy link to clipboard
Copied
Did you read the documentation in the Acrobat SDK?
Copy link to clipboard
Copied
Oh sure. And I can not understand what happened to me.
For two days I am writing a program for copying data from VPF to a prepared pdf form. When the form was opened, the Reader DC was loaded from the VPF. I wanted to slightly change the view of the Reader and for this I went to Acrobat Pro to find out the name of the menu item (View-> Read Mode Ctrl-H) in the js console. I do not understand, but after some time Acrobat Pro was downloaded instead of Reader.
I could not make a mistake, because they have different interfaces and I would have rushed to it yesterday.
Copy link to clipboard
Copied
Sorry, but I made a mistake with Reader.
Probably overheated.