Table of Contents

Class XForm

Namespace
PdfSharp.Drawing
Assembly
PdfSharp.dll

Represents a graphical object that can be used to render retained graphics on it. In GDI+ it is represented by a Metafile, in WPF by a DrawingVisual, and in PDF by a Form XObjects.

public class XForm : XImage, IDisposable
Inheritance
XForm
Implements
Derived
Inherited Members

Constructors

XForm()

Initializes a new instance of the XForm class.

protected XForm()

XForm(PdfDocument, XRect)

Initializes a new instance of the XForm class that represents a page of a PDF document.

public XForm(PdfDocument document, XRect viewBox)

Parameters

document PdfDocument

The PDF document.

viewBox XRect

The view box of the page.

XForm(PdfDocument, XSize)

Initializes a new instance of the XForm class that represents a page of a PDF document.

public XForm(PdfDocument document, XSize size)

Parameters

document PdfDocument

The PDF document.

size XSize

The size of the page.

XForm(PdfDocument, XUnit, XUnit)

Initializes a new instance of the XForm class that represents a page of a PDF document.

public XForm(PdfDocument document, XUnit width, XUnit height)

Parameters

document PdfDocument

The PDF document.

width XUnit

The width of the page.

height XUnit

The height of the page

Properties

BoundingBox

Gets or sets the bounding box.

public XRect BoundingBox { get; set; }

Property Value

XRect

Height

Get the width of the page identified by the property PageNumber.

[Obsolete("Use either PixelHeight or PointHeight. Temporarily obsolete because of rearrangements for WPF. Currently same as PixelHeight, but will become PointHeight in future releases of PDFsharp.")]
public override double Height { get; }

Property Value

double

HorizontalResolution

Gets 72, the horizontal resolution by design of a form object.

public override double HorizontalResolution { get; }

Property Value

double

PixelHeight

Get the height of the page identified by the property PageNumber.

public override int PixelHeight { get; }

Property Value

int

PixelWidth

Get the width of the page identified by the property PageNumber.

public override int PixelWidth { get; }

Property Value

int

PointHeight

Get the height in point of this image.

public override double PointHeight { get; }

Property Value

double

PointWidth

Get the width in point of this image.

public override double PointWidth { get; }

Property Value

double

Size

Get the size of the page identified by the property PageNumber.

public override XSize Size { get; }

Property Value

XSize

Transform

Gets or sets the transformation matrix.

public virtual XMatrix Transform { get; set; }

Property Value

XMatrix

VerticalResolution

Gets 72 always, the vertical resolution by design of a form object.

public override double VerticalResolution { get; }

Property Value

double

ViewBox

Gets the view box of the form.

public XRect ViewBox { get; }

Property Value

XRect

Width

Get the width of the page identified by the property PageNumber.

[Obsolete("Use either PixelWidth or PointWidth. Temporarily obsolete because of rearrangements for WPF. Currently same as PixelWidth, but will become PointWidth in future releases of PDFsharp.")]
public override double Width { get; }

Property Value

double

Methods

DrawingFinished()

This function should be called when drawing the content of this form is finished. The XGraphics object used for drawing the content is disposed by this function and cannot be used for any further drawing operations. PDFsharp automatically calls this function when this form was used the first time in a DrawImage function.

public void DrawingFinished()