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

Add width and height methods to Page #399

Closed yob closed 2 years ago

yob commented 2 years ago

Return the width and height of the page in PDF points, taking into account any page rotation.

Useful for some users, and as a bonus we can change Page#orientation to be calculated as a function of height and width.

Started developing a pattern in spec/integration_spec.rb where each file can have multiple specs. It's mostly text extraction in there now, but there's plenty of other of ways to use pdf-reader (like page orientation and dimensions). I started by asserting we return the correct height+width for pages that use rotation.