Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Acrobat SDK, question?
#1
Page 22 of this document gives an example of how Visual C++ could use the methods and properties available to Acrobat DC to go to a page. Would Quick Macros have any access to this? Thanks
#2
Macro Macro3187
Code:
Copy      Help
;/exe 1

IDispatch app._create("AcroExch.App")
IDispatch avdoc=app.GetActiveDoc()
IDispatch pageview = avdoc.GetAVPageView()
pageview.Goto(2)

or

Macro Macro3187
Code:
Copy      Help
;/exe 1
typelib Acrobat {78165D71-DF28-11d3-9A89-005004A56D53} 1.0
Acrobat.AcroApp app._create
IDispatch avdoc=app.GetActiveDoc()
IDispatch pageview = avdoc.GetAVPageView()
pageview.Goto(2)

I have only the free Acrobat DC version. I guess it is why this code does not work. Error "No such interface supported".
#3
Hi, so in my case, using Acrobat DC (Creative Cloud paid version), both pieces of code work perfectly. This is amazing. I have searched hi and low. There is no other way to do this. I thought I would have to create an entire application (which I am interested in doing). However, for now, this is super. Thanks so much! Smile
#4
I see when I use the Acrobat library the dot syntax window opens showing the classes available (ones matching the SDK document). However when I use some of them I get the message "Error (RT) in Macro31: 0x80040154, Class not registered. ?". How could I register the classes when needed? Thanks
Code:
Copy      Help
;/exe 1
typelib Acrobat {78165D71-DF28-11d3-9A89-005004A56D53} 1.0
Acrobat.AcroPDTextSelect app._create
IDispatch avdoc=app.GetNumText()
BSTR seltex = avdoc
out seltex
#5
All classes that need to register are registered by Acrobat. The error means that _create can't be used with that class or interface.

To get an object of that type, call a function that returns an object of that type. If that function returns IDispatch, try to use that type instead. Example:
Code:
Copy      Help
;IDispatch avdoc=app.GetActiveDoc()
Acrobat.AcroAVDoc avdoc=app.GetActiveDoc()
#6
Quote:All classes that need to register are registered by Acrobat. The error means that _create can't be used with that class or interface.
Super helpful. I know this will come up again knowing that will save me that confusion. Thanks
#7
Yes, what you suggested is the right idea. However, something quirky is going on. Not surprising because this whole SDK is quirky. When I use the code as you show.
Code:
Copy      Help
;/exe 1
typelib Acrobat {78165D71-DF28-11d3-9A89-005004A56D53} 1.0
Acrobat.AcroApp app._create
Acrobat.AcroAVDoc avdoc=app.GetActiveDoc()
str myt = avdoc.GetTitle()

out myt
or
Code:
Copy      Help
;/exe 1
typelib Acrobat {78165D71-DF28-11d3-9A89-005004A56D53} 1.0
Acrobat.AcroApp app._create
Acrobat.AcroAVDoc avdoc=app.GetActiveDoc()
avdoc.FindText("long", 0, 0, 0)
it works very well. However, when used with the AcroPDTextSelect method (below) I get all types of errors. The document makes it clear on this page (131) that the text result needs to be output in some type of loop. But I can even get basic results to fire.
Code:
Copy      Help
;/exe 1
typelib Acrobat {78165D71-DF28-11d3-9A89-005004A56D53} 1.0
Acrobat.AcroApp app._create
Acrobat.AcroPDTextSelect avdoc=app.GetActiveDoc()
int myt = avdoc.GetNumText()

out myt
Thanks
#8
So after more research, it appears that capabilities to receive text and images as data are not allowed by external applications. The only way to accomplish this is by programming and packaging everything into a plugin via a *.dll. Acrobat has to load this when it starts. This makes sense as why some methods work so good and other give "No such interface supported". I plan to create this *.dll or plugin as they call it. Adobe does not do a good job explaining how this SDK works. I do not understand why an SDK for something so defacto is so vague (one example, no explanations for anything). I plan to let them know it needs to be better, whether they do something, well...
   
However, Quick Macros is amazing. What it helps the Acrobat SDK do is super. I work with the Acrobat Embed API and was trying to mimic that functionality. I need Acrobat to record pages, go to pages, and find data. The use of these features is so that databases can find data in PDFs and not have to search for data repeatedly. Some of the plugins sold that do this cost over $1000. Quick Macros allows for superior functionality over these expensive plugins. The Acrobat Embed API does not work on an airplane (it is cloud only) this does. Smile


Forum Jump:


Users browsing this thread: 1 Guest(s)