class HexaPDF::Type::Form

Parent

Represents a form XObject of a PDF document.

See: PDF1.7 s8.10

Attributes

source_path[RW]

Returns the path to the PDF file that was used when creating the form object.

This value is only set when the form object was created by using the image loading facility (i.e. when treating a single page PDF file as image) and not when the form object was created in any other way (i.e. manually created or already part of a loaded PDF file).

Public Instance Methods

box()

Returns the rectangle defining the bounding box of the form.

canvas()

Returns the canvas for the form XObject.

The canvas object is cached once it is created so that its graphics state is correctly retained without the need for parsing its contents.

Note that a canvas can only be retrieved for initially empty form XObjects!

contents()

Returns the contents of the form XObject.

Note: This is the same as stream but here for interface compatibility with Page.

contents=(data)

Replaces the contents of the form XObject with the given string.

Note: This is the same as stream= but here for interface compatibility with Page.

process_contents(processor, original_resources: nil)

Processes the content stream of the form XObject with the given processor object.

The original_resources argument has to be set to a page's resources if this form XObject is processed as part of this page.

See: HexaPDF::Content::Processor

resources()

Returns the resource dictionary which is automatically created if it doesn't exist.