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 PDF::Reader::Point #404

Closed yob closed 2 years ago

yob commented 2 years ago

This is intended to be a mostly internal utility class, to help with positioning and math in a type safe way.

It will be exposed via the public API, but only in a handful of places to begin with. Like fetching the origin of page, or the MediaBox:

    PDF::Reader.open("somefile.pdf") do |pdf|
      pdf.pages.each do |page|
        puts page.origin.inspect
        puts page.rectangles[:MediaBox].inspect
      end
    end