Module | Prawn::Document::Internals |
In: |
lib/prawn/security.rb
lib/prawn/document/internals.rb |
This module exposes a few low-level PDF features for those who want to extend Prawn’s core functionality. If you are not comfortable with low level PDF functionality as defined by Adobe’s specification, chances are you won’t need anything you find here.
Appends a raw string to the current page content.
# Raw line drawing example: x1,y1,x2,y2 = 100,500,300,550 pdf.add_content("%.3f %.3f m" % [ x1, y1 ]) # move pdf.add_content("%.3f %.3f l" % [ x2, y2 ]) # draw path pdf.add_content("S") # stroke
The Name dictionary (PDF spec 3.6.3) for this document. It is lazily initialized, so that documents that do not need a name dictionary do not incur the additional overhead.
Creates a new Prawn::Reference and adds it to the Document’s object list. The data argument is anything that Prawn::PdfObject() can convert.
Returns the identifier which points to the reference in the ObjectStore
Like ref, but returns the actual reference instead of its identifier.
While you can use this to build up nested references within the object tree, it is recommended to persist only identifiers, and them provide helper methods to look up the actual references in the ObjectStore if needed. If you take this approach, Prawn::Document::Snapshot will probably work with your extension
Prawn/Security patches render_body so that it spits out encrypted content iff the document is encrypted.