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

Community Beginner ,
Feb 01, 2018 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

258

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
community guidelines
Adobe Community Professional ,
Feb 01, 2018 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. 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
community guidelines
Community Beginner ,
Feb 01, 2018 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
community guidelines
Adobe Employee ,
Feb 01, 2018 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
community guidelines
Community Beginner ,
Feb 01, 2018 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
community guidelines
Adobe Community Professional ,
Feb 01, 2018 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.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
community guidelines
Most Valuable Participant ,
Feb 01, 2018 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
community guidelines
Adobe Community Professional ,
Feb 01, 2018 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.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
community guidelines
Adobe Employee ,
Feb 02, 2018 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
community guidelines
Community Beginner ,
Feb 23, 2018 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
community guidelines
Adobe Employee ,
Feb 23, 2018 Feb 23, 2018

Copy link to clipboard

Copied

LATEST

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
community guidelines
Most Valuable Participant ,
Feb 23, 2018 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
community guidelines