Table of Contents

Class PdfFormXObject

Namespace
MiPdf.Graphics
Assembly
MiPdf.dll

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

document PdfDocument
stream PdfStream

PdfFormXObject(PdfDocument, PdfRectangle)

Creates a new form XObject with the given bounding box.

public PdfFormXObject(PdfDocument document, PdfRectangle bbox)

Parameters

document PdfDocument
bbox PdfRectangle

Properties

BBox

The bounding box (/BBox) in form space; an empty rectangle if missing.

public PdfRectangle BBox { get; set; }

Property Value

PdfRectangle

Document

The document that owns this XObject.

public PdfDocument Document { get; }

Property Value

PdfDocument

Height

Height of BBox in points.

public double Height { get; }

Property Value

double

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

Matrix?

Reference

The indirect reference of Stream in Document.

public PdfReference Reference { get; }

Property Value

PdfReference

Resources

The resource dictionary of the XObject; created if missing.

public PdfDictionary Resources { get; }

Property Value

PdfDictionary

Stream

The underlying XObject stream (dictionary and content).

public PdfStream Stream { get; }

Property Value

PdfStream

Width

Width of BBox in points.

public double Width { get; }

Property Value

double

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

category PdfName
resource PdfObject
prefix string

Returns

PdfName

GetCanvas()

Returns a canvas that writes into this XObject. Dispose the canvas to store the content.

public PdfCanvas GetCanvas()

Returns

PdfCanvas