Is there a way to draw JUST the annotations of a document without drawing the actual page?

Feb 01, 2018

Copy link to clipboard

Copied

I'm trying to draw the annotations of a document without actually drawing the page being annotated. I know there are methods like PDPageDrawContentsToMemoryEx() which draw the page to memory, is there any way to ignore the page, and just draw annotations?

TOPICS
Acrobat SDK and JavaScript

Views

252

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Is there a way to draw JUST the annotations of a document without drawing the actual page?

Feb 01, 2018

Copy link to clipboard

Copied

I'm trying to draw the annotations of a document without actually drawing the page being annotated. I know there are methods like PDPageDrawContentsToMemoryEx() which draw the page to memory, is there any way to ignore the page, and just draw annotations?

TOPICS
Acrobat SDK and JavaScript

Views

253

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 01, 2018 0
Feb 01, 2018

Copy link to clipboard

Copied

You want just the Annots to display on the main AVPageView?

It's possible you could interrupt the drawing process with the AVPageViewDrawProc Callback. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 01, 2018 0
Feb 01, 2018

Copy link to clipboard

Copied

If possible, I'd like to implement a cleaner solution which doesn't have to start and interrupt a process which was never needed in the first place. Essentially, I'm looking for some way to, given a PDF page as input, solely draw the annotations of that document. Does the SDK support any straight forward ways of solving this problem? 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 01, 2018 0
Adobe Employee ,
Feb 01, 2018

Copy link to clipboard

Copied

If you are drawing these to your own raster buffer, then you can do this by iterating over each annotation on the page (aka walk the Annots array), get the normal appearance dictionary for each, then use PDDrawPageOrCosObjectToBuffer to do just that.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 01, 2018 0
Feb 01, 2018

Copy link to clipboard

Copied

As far as I can tell, there is not documentation for this method online (It's not listed in online reference P (PDFL)​​). Am I missing something?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 01, 2018 0
Feb 01, 2018

Copy link to clipboard

Copied

The functions are named PDPageDrawContentsToWindow and PDDrawCosObjToWindow

Neither function draws to an actual window. They draw to a graphics context. This might be a window, or it might be a memory buffer. It all depends on how you set it up. The input to the function is just the handle to the context.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 01, 2018 0
Feb 01, 2018

Copy link to clipboard

Copied

PDDrawPageOrCosObjectToBuffer Exists in Acrobat DC.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 01, 2018 0
Feb 01, 2018

Copy link to clipboard

Copied

Ha ha, that's funny. I thought Leonard ran the words together

And here's the reference entry:

Acrobat and PDF Library API Reference

Cool, I'll get to this in a couple of years. I always write to an older SDK (10 right now) cause it's quite common for my customers, and their customers, to be using older versions of Acrobat. Besides I don't trust all this new fangled stuff. You never know how it's going to work out. Best to stick with tried and true methods.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 01, 2018 0
Adobe Employee ,
Feb 02, 2018

Copy link to clipboard

Copied

This is one of those cases where newer is better! We added the new API after a long review of all the existing drawing APIs and working out a new model/approach that addresses problems with the others. Unless you are supporting unsupported versions of Acrobat (aka X and XI), then PLEASE use the new API.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 02, 2018 1
Feb 23, 2018

Copy link to clipboard

Copied

lrosenth Is PDDrawPageOrCosObjectToBuffer actually available on all platforms and with ​all products as it says in the documentation? This API does not appear to be exposed to the library I am using.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 23, 2018 0
lrosenth LATEST
Adobe Employee ,
Feb 23, 2018

Copy link to clipboard

Copied

Acrobat DC and PDFL. YES.

Get Outlook for iOS<https://aka.ms/o0ukef>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 23, 2018 0
Feb 23, 2018

Copy link to clipboard

Copied

What "library" are you using? It is in the plug-in API, which is not a library of any kind.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 23, 2018 0