class HexaPDF:: Type:: Form
Parent | HexaPDF::Stream |
---|
Represents a form XObject of a PDF document.
See: PDF2.0 s8.10
Field Definitions
Name | Type/Allowed Values | Required | Default Value |
---|---|---|---|
Length | Integer | false | nil |
Filter | Symbol or HexaPDF::PDFArray or Array | false | nil |
DecodeParms | HexaPDF::Dictionary or HexaPDF::PDFArray or Hash or Array | false | nil |
F | HexaPDF::Type::FileSpecification or Hash or String | false | nil |
FFilter | Symbol or HexaPDF::PDFArray or Array | false | nil |
FDecodeParms | HexaPDF::Dictionary or HexaPDF::PDFArray or Hash or Array | false | nil |
DL | Integer | false | nil |
Type | Symbol | false | :XObject |
Subtype | Symbol | true | :Form |
FormType | Integer One of: 1 | false | 1 |
BBox | HexaPDF::Rectangle or Array | true | nil |
Matrix | HexaPDF::PDFArray or Array | false | [1, 0, 0, 1, 0, 0] |
Resources | HexaPDF::Type::Resources or Hash | false | nil |
Group | HexaPDF::Type::Form::Group or Hash | false | nil |
Ref | HexaPDF::Type::Form::Reference or Hash | false | nil |
Metadata | HexaPDF::Stream or Hash | false | nil |
PieceInfo | HexaPDF::Dictionary or Hash | false | nil |
LastModified | HexaPDF::DictionaryFields::PDFDate or String or Time or Date or DateTime | false | nil |
StructParent | Integer | false | nil |
StructParents | Integer | false | nil |
OPI | HexaPDF::Dictionary or Hash | false | nil |
OC | HexaPDF::Dictionary or Hash | false | nil |
Name | Symbol | false | nil |
AF | HexaPDF::PDFArray or Array | false | nil |
Measure | HexaPDF::Dictionary or Hash | false | nil |
PtData | HexaPDF::Dictionary or Hash | false | nil |
Attributes
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
Returns the rectangle defining the bounding box of the form.
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.
If the bounding box of the form XObject doesn’t have its origin at (0, 0), the canvas origin is translated into the bottom-left corner so that this detail doesn’t matter when using the canvas. This means that the canvas’ origin is always at the bottom-left corner of the bounding box.
Note that a canvas can only be retrieved for initially empty form XObjects!
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.
Returns the resource dictionary which is automatically created if it doesn’t exist.