PDFsharp-net6

XForm

Namespace: PdfSharp.Drawing

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, System.IDisposable, PdfSharp.Pdf.Advanced.IContentStream

Inheritance ObjectXImageXForm
Implements IDisposable, IContentStream

Properties

Width

Caution

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.


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

public double Width { get; }

Property Value

Double

Height

Caution

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.


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

public double Height { get; }

Property Value

Double

PointWidth

Get the width in point of this image.

public double PointWidth { get; }

Property Value

Double

PointHeight

Get the height in point of this image.

public double PointHeight { get; }

Property Value

Double

PixelWidth

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

public int PixelWidth { get; }

Property Value

Int32

PixelHeight

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

public int PixelHeight { get; }

Property Value

Int32

Size

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

public XSize Size { get; }

Property Value

XSize

ViewBox

Gets the view box of the form.

public XRect ViewBox { get; }

Property Value

XRect

HorizontalResolution

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

public double HorizontalResolution { get; }

Property Value

Double

VerticalResolution

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

public double VerticalResolution { get; }

Property Value

Double

BoundingBox

Gets or sets the bounding box.

public XRect BoundingBox { get; set; }

Property Value

XRect

Transform

Gets or sets the transformation matrix.

public XMatrix Transform { get; set; }

Property Value

XMatrix

Interpolate

Gets or sets a flag indicating whether image interpolation is to be performed.

public bool Interpolate { get; set; }

Property Value

Boolean

Format

Gets the format of the image.

public XImageFormat Format { get; }

Property Value

XImageFormat

Constructors

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

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()

AssociateGraphics(XGraphics)

Called from XGraphics constructor that creates an instance that work on this form.

internal void AssociateGraphics(XGraphics gfx)

Parameters

gfx XGraphics

Dispose(Boolean)

Disposes this instance.

protected void Dispose(bool disposing)

Parameters

disposing Boolean

Finish()

Sets the form in the state FormState.Finished.

internal void Finish()

GetFontName(XFont, PdfFont&)

Gets the resource name of the specified font within this form.

internal string GetFontName(XFont font, PdfFont& pdfFont)

Parameters

font XFont

pdfFont PdfFont&

Returns

String

TryGetFontName(String, PdfFont&)

Tries to get the resource name of the specified font data within this form. Returns null if no such font exists.

internal string TryGetFontName(string idName, PdfFont& pdfFont)

Parameters

idName String

pdfFont PdfFont&

Returns

String

GetFontName(String, Byte[], PdfFont&)

Gets the resource name of the specified font data within this form.

internal string GetFontName(string idName, Byte[] fontData, PdfFont& pdfFont)

Parameters

idName String

fontData Byte[]

pdfFont PdfFont&

Returns

String

GetImageName(XImage)

Gets the resource name of the specified image within this form.

internal string GetImageName(XImage image)

Parameters

image XImage

Returns

String

GetFormName(XForm)

Gets the resource name of the specified form within this form.

internal string GetFormName(XForm form)

Parameters

form XForm

Returns

String