pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michel Cozzolino <mikicozzol...@gmail.com>
Subject outline pagedestination problem
Date Sun, 25 Nov 2018 10:14:25 GMT
Hi,
I'm a newbie on PDFBOX. I've to extract bookmarks and relevant destination
pages from customer generated pdfs. All the pdf files have the very same
structure.
Opening such pdf in a pdf reader I see the bookmarks with pages.


[image: image.png]

But looking for page-destination in both PageDestination and ActionGoto
modes, results in error. In fact both the following "if" statements result
false:
(Kotlin code)

val document: *PDDocument* = load(file)
val outline: *PDDocumentOutline!* = document.documentCatalog.documentOutline
var current: PDOutlineItem? = outline.firstChild
if (current.destination is PDPageDestination) --> results *false*
if (current.action is PDActionGoTo)  --> results *false* too

current.title  --> results the *correct* value

what am I doing wrong? Is there other way pdf store bookmark page
destinations?
Is there a way to analyse the structure of the "current" object?
Thanks for help!

Michele

Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message