Any way to read GoTo destinations?

26 views
Skip to first unread message

Wayne Brissette

unread,
Jun 21, 2017, 7:16:11 PM6/21/17
to pdf-r...@googlegroups.com
James (or anybody else):

I'm trying to see if there's a way that I could read the names of the GoTo address (xref) in a PDF document. Looking at the PDF Spec, there seems to be a way, but I can quite sort out the right combination with PDF-Reader.

Anybody have luck doing this?

Wayne

James Healy

unread,
Jun 24, 2017, 11:05:29 AM6/24/17
to pdf-r...@googlegroups.com
So you'd like access to the raw offset numbers that are stored in the
xref table(s)?

pdf-reader definitely reads those numbers, but they're currently not
exposed via a public API.

The data is stored in a private instance variable on
`PDF::Reader::ObjectHash`, so you could hack a solution together as a
trial:

xref = PDF::Reader.new("file.pdf").objects.send(:xref)

James
> --
> You received this message because you are subscribed to the Google Groups "PDF::Reader" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pdf-reader+...@googlegroups.com.
> To post to this group, send email to pdf-r...@googlegroups.com.
> Visit this group at https://groups.google.com/group/pdf-reader.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages