Class PdfFormXObject
A form XObject: a reusable piece of content with its own coordinate system and resources (used for templates, stamps and annotation/field appearances).
public sealed class PdfFormXObject : IResourceContainer
- Inheritance
-
PdfFormXObject
- Implements
- Inherited Members
Constructors
PdfFormXObject(PdfDocument, PdfStream)
Wraps an existing form XObject stream.
public PdfFormXObject(PdfDocument document, PdfStream stream)
Parameters
documentPdfDocumentstreamPdfStream
PdfFormXObject(PdfDocument, PdfRectangle)
Creates a new form XObject with the given bounding box.
public PdfFormXObject(PdfDocument document, PdfRectangle bbox)
Parameters
documentPdfDocumentbboxPdfRectangle
Properties
BBox
The bounding box (/BBox) in form space; an empty rectangle if missing.
public PdfRectangle BBox { get; set; }
Property Value
Document
The document that owns this XObject.
public PdfDocument Document { get; }
Property Value
Height
Height of BBox in points.
public double Height { get; }
Property Value
Matrix
Optional transformation from form space to user space (/Matrix); null if missing or malformed (the identity matrix applies then). Setting null removes the entry.
public Matrix? Matrix { get; set; }
Property Value
Reference
public PdfReference Reference { get; }
Property Value
Resources
The resource dictionary of the XObject; created if missing.
public PdfDictionary Resources { get; }
Property Value
Stream
The underlying XObject stream (dictionary and content).
public PdfStream Stream { get; }
Property Value
Width
Width of BBox in points.
public double Width { get; }
Property Value
Methods
AddResource(PdfName, PdfObject, string)
Registers resource in the category sub-dictionary of Resources
(e.g. /Font, /XObject) under a new name prefix1, 2, ... and returns that name.
A reference that is already registered returns its existing name.
public PdfName AddResource(PdfName category, PdfObject resource, string prefix)
Parameters
Returns
GetCanvas()
Returns a canvas that writes into this XObject. Dispose the canvas to store the content.
public PdfCanvas GetCanvas()