DynaPDF Bookmark Position on Page

I’m creating PDF viewer (drawing the displayed page as a picture) for use in my Apps and want to support bookmarks
In this case the PDFs originated as word documents that get converted to PDF by Acrobat Pro, and the Word Table of Contents becomes bookmarks in the PDF

What I want is if the zoom level is set such that the bookmarked item would be out of view I want to scroll to being it into view and perhaps highlight it…

I thought DynaPDFBookmark.DestRect woudl have the info I need with dimensions in points, but these bookmarks only have values in some of the properties:

But I can’t make sense of what Bottom is and in these PDFs at least, Bookmark.Width = - Bookmark.Left and Bookmark.Left always = 69!

Looking at docs it seems these value MIGHT depend on Bookmark.DestType … but that is 0 and that does not seem to one of the documented options, so what does BookMark.Bottom represent!!!

Apparently location information for the bookmark is defined internally correctly as viewers such a Preview do scroll to the right location on the page when a bookmark is selected.

How can I get the information i need to do this?


Well, it’s not so easy to handle bookmarks with all these little rules.
So type 0 is kdtXY_Zoom, three parameters (a, b, c) → (X, Y, Zoom).

And X is put into Left, Y into Bottom and Zoom into Right of the rectangle.

So when I see such a rectangle: 70/0 0/475
I now see it doesn’t make sense as a rectangle here. So if DestType is 0, you scroll to 70/475 with default scale since that is zero.

Sorry for the confusion. I’ll ask to document that better.

Thanks Christian,

I have it working now for type 0
For the other options making clear what parameters are in which properties of the rect in the docs for the bookmark class (as well as in the setting method) would help!


Yes. Jens is working on it.