Module | Prawn::Document::Internals
In: | 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.

### Methods

add_content names page_fonts page_resources page_xobjects proc_set ref

### Public Instance methods

add_content(str)

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

names()

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.

page_fonts()

The Font dictionary for the current page

page_resources()

The Resources dictionary for the current page

page_xobjects()

The XObject dictionary for the current page

proc_set(*types)

Add a new type to the current pages ProcSet

ref(data, &block)

Creates a new Prawn::Reference and adds it to the Document‘s object list. The `data` argument is anything that Prawn::PdfObject() can convert.

If a block is given, it will be invoked just before the object is written out to the PDF document stream. This allows you to do deferred processing on some references (such as fonts, which you might know all the details about until the last page of the document is finished).

[Validate]