yob / pdf-reader

The PDF::Reader library implements a PDF parser conforming as much as possible to the PDF specification from Adobe.
MIT License
1.81k stars 271 forks source link

page_references behavior has changed and documentation no longer matches #443

Closed petergoldstein closed 2 years ago

petergoldstein commented 2 years ago

The comment found here - https://github.com/yob/pdf-reader/blob/bed898f631685d0fe6a2d348604eaabce7d38d83/lib/pdf/reader/object_hash.rb#L460 - does not appear to accurately describe the return value of page_references. As of version 2.9 this method now appears to return an array of Hashes, rather than an array of PDF::Reader::Reference objects.

I'm assuming this is a deliberate change and the documentation is just out of date.

yob commented 2 years ago

Hmm, interesting.

Previously all of the PDF::Reader::Reference instances were pointers to a Hash, and I naively assumed any consumers would be dereferencing the PDF::Reader::Reference into a Hash any time they used it. That's probably true in the vast majority of cases, but it's reasonable that prawn-templates might have other plans.

I think I consider this a bug, and I'll look into a fix.

petergoldstein commented 2 years ago

@yob Great. That'd be helpful. Please let me know if there's any way I can assist.