Forum Discussion

fayrehouse's avatar
fayrehouse
Frequent Contributor
11 years ago
Solved

Anyone tried Adobe Acrobat API?

Hi All,



Has anyone done any automating of Adobe Acrobat - ideally via API?



In true Adobe style the API looks like it's more complicated than it needs to be.



I basically need to check text in an opened Adobe Window, and (I believe) ensure required images are in there aswell.



Hints, Tips and suggestions welcomed!





7 Replies

  • fayrehouse's avatar
    fayrehouse
    Frequent Contributor
    Thanks Tanya, 



    However, I fear I clicked "accept answer" a bit too soon - you ARE correct, but I'm still having a few problems... Initially when I open the PDF I'm working with, the document was seen as a single object - despite having the MSAA plugin installed etc etc. The object isseen as:



    Sys.Process("AcroRd32", 2).Window("AcrobatSDIWindow", "mydocname.pdf - Adobe Reader", 1).Window("AVL_AVView", "AVSplitterView", 4).Window("AVL_AVView", "AVSplitationPageView", 3).Window("AVL_AVView", "AVSplitterView", 1).Window("AVL_AVView", "AVScrolledPageView", 1).Window("AVL_AVView", "AVScrollView", 1).Edit("Alert: Document being processed.")



    After some investigation I've found the following:



    I have to go (in TC) File/Install Extensions, Click "OK" (the MSAA plugin is already installed. After this, then the individual "bits" of my PDF are seen by TC. Seemingly, I have to open/close the Install Extensions dialog each time I open a PDF! This is no good, long term... Can you suggest anything here that might be the cause?

  • fayrehouse's avatar
    fayrehouse
    Frequent Contributor
    Ignore that  - it's seemingly just this... Ahem... not overly modern laptop I'm using, takes time processing the PDF tags....



    Once I give it 10-15s, it catches up ;-)



    A great answer Tanya, thank you :)
  • Hi Tanya,



    I'm having the same problem that Steve had months ago.



    When I try to read the text of a PDF opened with acrobat reader, sometimes the object which contains the info I want is:



    NameMapping.Sys.Process("AcroRd32").Window("AcrobatSDIWindow", "LAB0001_201407020808522 (1).pdf - Adobe Reader", 1).Window("AVL_AVView", "AVToolBarHostView", 1).Window("AVL_AVView", "AVSplitterView", 4).Window("AVL_AVView", "AVSplitationPageView", 3).Window("AVL_AVView", "AVSplitterView", 1).Window("AVL_AVView", "AVScrolledPageView", 1).Window("AVL_AVView", "AVScrollView", 1).Edit(0)



    and sometimes it is:



    NameMapping.Sys.Process("AcroRd32").Window("AcrobatSDIWindow", "LAB0001_201407020808522 (1).pdf - Adobe Reader", 1).Window("AVL_AVView", "AVToolBarHostView", 1).Window("AVL_AVView", "AVSplitterView", 4).Window("AVL_AVView", "AVSplitationPageView", 3).Window("AVL_AVView", "AVSplitterView", 1).Window("AVL_AVView", "AVScrolledPageView", 1).Window("AVL_AVView", "AVScrollView", 1).Edit("Alert: Document being processed.")



    In the second case, I can not access information. I have seen that saving the settings of "Install extensions" I do access information of this object.



    Would you know if I have to make any extra configuration?



    I'm using acrobat reader 9.5.1.



    Thanks in advance!
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Raul,



    I guess that when .Edit("Alert: Document being processed.") object exists this means that the relevant window is shown in Adobe Acrobat. If my guess is correct, then you must wait until the window closes and try to get a reference to .Edit(0) object one more time.

  • Hi Alexei!


    I don't understand when you say "the relevant window is shown in Adobe Acrobat".


    Do you mean that I should close something?

     


    Maybe is a problem in how the document is opened, but not of waiting. I can wait for a long time and this object remains "Alert: Document being processed."

     


    And, as I said, it's very strange that this object changes when I save the settings of "Install extensions"...



    Thanks!

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Raul,



    > I don't understand when you say "the relevant window is shown in Adobe Acrobat".

    What I meant was that, for example the version of Acrobat Reader installed on my box, quite often displays the window with the text like "Preparing document" and a progress bar when I open dome .pdf document in it.

    I usually do nothing with this and just wait until this window closes.

    So I guess that some similar temporary window is shown in your case too and you should just wait until it disappears and continue with the script execution.