29 Replies Latest reply: May 21, 2015 8:55 AM by jumpjack2_ RSS

    AcroExch.App with Adobe Reader

    Daktor

      If a computer only has Adobe Reader installed, can an application running on that computer interact with a pdf document via OLE?  In particular, can an application on that computer use AcroExch.App and AcroExch.AVDoc objects?

       

      Example code:

       

      #import "acrobat.tlb" rename_namespace("ACROBAT"), auto_rename

       

      ACROBAT::CAcroAppPtr app("AcroExch.App");

      ACROBAT::CAcroAVDocPtr avDoc("AcroExch.AVDoc");
      ACROBAT::CAcroPDDocPtr pdDoc;

       

      avDoc->Open(TEXT("c:\\example.pdf"), TEXT(""));

      pdDoc = avDoc->GetPDDoc();
      pdDoc->OpenAVDoc("Title");

       

      Currently creating app gives error: Invalid class string

       

      Thanks!

        • 1. Re: AcroExch.App with Adobe Reader
          Bernd Alheit MVP

          > If a computer only has Adobe Reader installed, can an application  running on that computer interact with a pdf document via OLE?

           

          No,

           

          > In  particular, can an application on that computer use AcroExch.App and  AcroExch.AVDoc objects?

           

          No.

          • 2. Re: AcroExch.App with Adobe Reader
            lrosenth Adobe Employee

            No, it cannot.  Reader doesn't support COM/OLE automation.

            • 3. Re: AcroExch.App with Adobe Reader
              Daktor Community Member

              Thank you for the very fast response.  One follow-up question:

               

              Assume I buy Adobe Acrobat to develop this application and use OLE to interact with pdf documents in the application.

               

              Will my clients need to also buy Adobe Acrobat for the application to work on their computers?  Or can I package it with my application behind the scenes?

               

              Thanks again!

              • 4. Re: AcroExch.App with Adobe Reader
                lrosenth Adobe Employee

                Yes, your clients would need to purchase Acrobat for your application to work.  It needs to be installed on every computer on which your software would operate.

                 

                And remember that Acrobat can NOT be automated to do work for someone not licensed to use it....

                • 5. Re: AcroExch.App with Adobe Reader
                  athirukk Community Member

                  Related to this post, lets say I get the approval from Adobe (RIKLA stuff), will these classes work for Reader plugin?

                   

                  i.e AcroAppClass and CAcroPDDoc

                   

                  If not, what are the Reader plugin APIs available in SDK that does text extraction and highlight functionality in Reader (which is my only 2 requirement now).

                  • 6. Re: AcroExch.App with Adobe Reader
                    lrosenth Adobe Employee

                    No, because they simply do not exist in Reader.  They only exist in Acrobat.

                     

                    But if you are writing a plugin, why do you need them?  There are much better APIs (PDWordFinder, etc.) available to you via plugins...

                    • 7. Re: AcroExch.App with Adobe Reader
                      athirukk Community Member

                      What I was trying is to get hold of ActiveDoc once I pass on the control from Plugin code to my C# code, so that I can extract text and do the highlight stuff with the help of AcroAppClass  and CAcroPDDoc.

                       

                      Ok. PDWordFinder will solve one of my problem as it will work for Reader. Now I can extract text from a Reader document and send it to my C# Form from plugin.

                       

                      Now, from that Windows Form code, how can I highlight a particular word back in the PDF document. Is there a Reader supported API (HiliteEntry?)

                      • 8. Re: AcroExch.App with Adobe Reader
                        lrosenth Adobe Employee

                        Yeah, that won't work with Reader - sorry!  You will need to do the extraction in the plugin and then send that extracted text to the C# code.

                         

                        You will need to send info back to the plugin to tell it what you want hilited and then it can do it...

                        • 9. Re: AcroExch.App with Adobe Reader
                          athirukk Community Member

                          Thats great,atleast I have a way to talk back to Reader document from C#.

                           

                          Can you please point me some SDK sample code which does this handshake? Meaning, invoking the plugin method from outside plugin code (in my case from C# Winform to plugin code to highlite a word).

                          • 10. Re: AcroExch.App with Adobe Reader
                            lrosenth Adobe Employee

                            Sorry, no samples of this type of thing - but that's because it's not Acrobat/Reader centric.  Do whatever you want to communicate...

                            • 11. Re: AcroExch.App with Adobe Reader
                              athirukk Community Member

                              Thanks!

                               

                              But if there is a sample which atleast invokes a plugin method from outside, that will really help me to proceed further.

                              Or any direction of this sort will also helpful.

                              • 12. Re: AcroExch.App with Adobe Reader
                                athirukk Community Member

                                Can any one answer my previous question?

                                 

                                I am searching SDK documentation and I found something called HFT. Is that the solution for my requirement, i.e invoking a plugin method from outside?

                                 

                                Please let me know.

                                • 13. Re: AcroExch.App with Adobe Reader
                                  athirukk Community Member

                                  Replying to my own questions above....found a DDE (very old IAC technique and not usually recommended tough ) way to talk to Acrobat/Reader instance (called as DDE Server). There is a sample project which demonstrates DDE and it is in C++.

                                   

                                  As I need to talk from my Winform, I am gonna use Ndde (open source) to talk back to Acrobat/Reader instance.

                                   

                                  It would be more helpful if some sample code/project is available in SDK to demonstrate IAC via COM/OLE as DDE is a very old technique.

                                   

                                  -AT

                                  • 14. Re: AcroExch.App with Adobe Reader
                                    lrosenth Adobe Employee

                                    Adobe Reader doesn't support COM/OLE - only DDE.

                                    • 15. Re: AcroExch.App with Adobe Reader
                                      athirukk Community Member

                                      Irosenth, this is kinda contradicting. I remember you were saying "If Adobe approves your Reader plugin, then it can do what ever". Meaning COM/OLE/Named pipes. I thought COM/OLE is available for Reader, but your above reply says it strictly supports only DDE (which is gud for me as I hav explained above, am using DDE to send messages back to Reader instance to invoke the Highlite plugin function ).

                                       

                                      Please can you clarify why COM/OLE is not available for Reader and why only old technique, DDE is available for Reader?

                                      • 16. Re: AcroExch.App with Adobe Reader
                                        lrosenth Adobe Employee

                                        Sorry - OK for you to do from your plugin.  (I was referring to built-in support)

                                        • 17. Re: AcroExch.App with Adobe Reader
                                          athirukk Community Member

                                          Thats convincing to me and good to know that Reader will support IAC via COM apart from DDE. I will try to create a COM component and expose the Highlite API, add reference to my C# Winform and invoke it from there.

                                          • 18. Re: AcroExch.App with Adobe Reader
                                            sidharthnitj

                                            Hi Athirukk

                                             

                                            from above posts, it appear you have worked good deal to edit pdf docs without using SDK ( with the help of plugins/DDE).

                                             

                                            can you please help me what was the result . as i have the similar issue (ActiveX is not able to create objects for data points i have in the code @  http://forums.adobe.com/message/4109842 ).

                                             

                                            apprciate any guidance.

                                             

                                            regards

                                            Sidharth

                                            • 19. Re: AcroExch.App with Adobe Reader
                                              athirukk Community Member

                                              Sid - What I had achieved using Ndde (opensource) is to make a connection from .Net code (Winform) to C++ code (Adobe Plugin). All my code does is to invoke C++ code from .Net to retrieve (read only) the contents/text of a PDF document and I did not do any EDITING.

                                               

                                              What are you trying to achieve?

                                               

                                              -AT

                                              • 20. Re: AcroExch.App with Adobe Reader
                                                sidharthnitj Community Member

                                                athirukk- i need to write reference text on pdf docs..with acrobat this is possible as confirmed by Irosenth....however was thinking if it is possible without spending any money...

                                                 

                                                i will look at ndde....however any direction u want me to point ..

                                                • 21. Re: AcroExch.App with Adobe Reader
                                                  Bernd Alheit MVP

                                                  Without spending money you can't create plug-ins for Adobe Reader.

                                                  • 22. Re: AcroExch.App with Adobe Reader
                                                    athirukk Community Member

                                                    As Bernd mentioned, you have to get RIKLA from Adobe to make your plugin work for Reader.

                                                    • 23. Re: AcroExch.App with Adobe Reader
                                                      jumpjack2_ Community Member

                                                      So can I use  Reader DDE automation to access PDF comments/annotations using VBA?

                                                      • 24. Re: AcroExch.App with Adobe Reader
                                                        Bernd Alheit MVP

                                                        Did you read the documentation?

                                                        • 25. Re: AcroExch.App with Adobe Reader
                                                          jumpjack2_ Community Member

                                                          Do you mean those 500+ pages of confused and useless official documentation or the 40+ sites/blogs/forums I visited before asking?

                                                          Couldn't adobe just clearly state in the two sdks download pages who can use them and how to use them? I think I downloaded 100 MB of useless stuff, maybe I just need to know how to access acrord32.dll functions from VBA... if just this was explained somewhere...

                                                          • 26. Re: AcroExch.App with Adobe Reader
                                                            Bernd Alheit MVP

                                                            The documentation is part of the Acrobat SDK.

                                                            • 27. Re: AcroExch.App with Adobe Reader
                                                              jumpjack2_ Community Member

                                                              The documentation is an overwhelming mess, anyway at the end I figured out what I need to know.

                                                               

                                                              This is an example annotation saved into an FDF file:

                                                               

                                                              <</C[1.0 1.0 1.0]/CL[91.8331 536.61 162.546 562.254 174.546 562.254]/Contents(COMMENT CONTENT)/CreationDate(D:20150521145021+02'00')/DA(1 0 0 rg /Helv 12 Tf)/DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#FF0000 )/F 4/IT/FreeTextCallout/LE/OpenArrow/M(D:20150521151125+02'00')/NM(4dd302eb-83fd-4cf2-b4a6-f 84c096ad11a)/Page 0/RC(<?xml version="1.0"?><body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:APIVersion="Acrobat:11.0.6" xfa:spec="2.0.2"  style="font-size:12.0pt;text-align:left;color:#FF0000;font-weight:normal;font-style:norma \

                                                              l;font-family:Helvetica,sans-serif;font-stretch:normal"><p dir="ltr"><span style="font-family:Helvetica">commento</span></p></body>)/RD[82.7728 20.7243 0.5 0.5]/Rect[91.7732 534.719 283.046 571.953]/Subj(Callout)/Subtype/FreeText/T(ANNOTATION AUTHOR)/Type/Annot>>

                                                               

                                                              More readable fashion:

                                                              <<

                                                              /C[1.0 1.0 1.0]

                                                              /CL[91.8331 536.61 162.546 562.254 174.546 562.254]

                                                              /Contents(COMMENT CONTENT)

                                                              /CreationDate(D:20150521145021+02'00')

                                                              /DA(1 0 0 rg /Helv 12 Tf)

                                                              /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#FF0000 )

                                                              /F 4

                                                              /IT/FreeTextCallout

                                                              /LE/OpenArrow

                                                              /M(D:20150521151125+02'00')

                                                              /NM(4dd302eb-83fd-4cf2-b4a6-f84c096ad11a)

                                                              /Page 0

                                                              /RC(<?xml version="1.0"?><body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:APIVersion="Acrobat:11.0.6" xfa:spec="2.0.2"  style="font-size:12.0pt;text-align:left;color:#FF0000;font-weight:normal;font-style:norma \

                                                              l;font-family:Helvetica,sans-serif;font-stretch:normal"><p dir="ltr"><span style="font-family:Helvetica">COMMENT CONTENT</span></p></body>)

                                                              /RD[82.7728 20.7243 0.5 0.5]

                                                              /Rect[91.7732 534.719 283.046 571.953]

                                                              /Subj(Callout)

                                                              /Subtype

                                                              /FreeText

                                                              /T(ANNOTATION AUTHOR)

                                                              /Type

                                                              /Annot

                                                              >>

                                                               

                                                               

                                                               

                                                              "<<" and ">>" mark start/end of annotation

                                                              /C ? (who cares? :-) )

                                                              /CL = "CaLlout annotation", i.e. "a box with an arrow"; 6 numbers after /CL are coordinates of, in order:

                                                              • arrow end
                                                              • curve
                                                              • arrow start

                                                              Coordinates are relative to lower-left angle of the page.

                                                              /Contents  (obvious)

                                                              /CreationDate (obvious)

                                                              /DA Default Appearance

                                                              /DS Default Style

                                                              /F Flags  (4 = nozoom)

                                                              /IT type of annotation: FreeText, FreeTextCallout,FreeTextTypewriter

                                                              /LE Style of the arrow

                                                              /NM is the unique id of the annotation (I don't need it for exporting).

                                                              /Page (obvious)

                                                              /RC containts a RiCh text version of the comment (i.e. supporting formatting)

                                                              /RD Textbox margins

                                                              /Rect Textbox containing the comment

                                                              /T Author of the annotation

                                                               

                                                              So actually all I need to extract the list of comments and where the arrows point to is:

                                                              • Find "<<"
                                                              • Find "/CL" and get first two numbers inside [ ]
                                                              • Find "/Contents" and read string inside ( )
                                                              • Find "/page" and read number after space

                                                               

                                                               

                                                               

                                                              Data taken  from table 170 and 174 in _0_PDF32000_2008.

                                                              • 28. Re: AcroExch.App with Adobe Reader
                                                                Bernd Alheit MVP

                                                                I assumed you looks for the documentation of the DDE commands of Acrobat Reader.

                                                                • 29. Re: AcroExch.App with Adobe Reader
                                                                  jumpjack2_ Community Member

                                                                  Yes... if it allows exporting comments.