Copy link to clipboard
Copied
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!
> 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.
Copy link to clipboard
Copied
So can I use Reader DDE automation to access PDF comments/annotations using VBA?
Copy link to clipboard
Copied
Did you read the documentation?
Copy link to clipboard
Copied
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-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">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:
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:
Data taken from table 170 and 174 in _0_PDF32000_2008.
Copy link to clipboard
Copied
I assumed you looks for the documentation of the DDE commands of Acrobat Reader.
Copy link to clipboard
Copied
Yes... if it allows exporting comments.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more