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?
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.
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?
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.
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?
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.
Copy link to clipboard
Copied
PDDrawPageOrCosObjectToBuffer Exists in Acrobat DC.
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.
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.
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.
Copy link to clipboard
Copied
Acrobat DC and PDFL. YES.
Get Outlook for iOS<https://aka.ms/o0ukef>
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.