ajrcarey / pdfium-render

A high-level idiomatic Rust wrapper around Pdfium, the C++ PDF library used by the Google Chromium project.
https://crates.io/crates/pdfium-render
Other
364 stars 59 forks source link

Missing `dest` in `PdfBookmark` #122

Closed xVanTuring closed 1 year ago

xVanTuring commented 1 year ago

Pdfium's Bookmark has a Dest(FPDFBookmark_GetDest), Some pdf(like the one below) do not have action in bookmark, the Dest will be used to jump page, but I couldn't find it in the PdfBookmark. Bookmark.pdf

ajrcarey commented 1 year ago

Hi @xVanTuring , many thanks for adding this. I have merged your pull request, although I may rename the dest() function to destination() to better match the existing equivalent in PdfAction.

In the comments for the pull request, you mentioned automated tests:

Aside from the issue, I'm curious if we need some automated tests(something like a e2e, for pdf processing) and I could try to help write and maintain some tests.

I'm open to this, although in an ideal world I would want to push the burden of processing upstream to the Pdfium maintainers. Did you have some specific tests in mind?

ajrcarey commented 1 year ago

Renamed PdfBookmark::dest() to PdfBookmark::destination() for consistency. Updated README. Ready to publish as part of crate release 0.8.16.