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 Object → XImage → XForm
Implements IDisposable, IContentStream
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; }
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; }
Get the width in point of this image.
public double PointWidth { get; }
Get the height in point of this image.
public double PointHeight { get; }
Get the width of the page identified by the property PageNumber.
public int PixelWidth { get; }
Get the height of the page identified by the property PageNumber.
public int PixelHeight { get; }
Get the size of the page identified by the property PageNumber.
public XSize Size { get; }
Gets the view box of the form.
public XRect ViewBox { get; }
Gets 72, the horizontal resolution by design of a form object.
public double HorizontalResolution { get; }
Gets 72 always, the vertical resolution by design of a form object.
public double VerticalResolution { get; }
Gets or sets the bounding box.
public XRect BoundingBox { get; set; }
Gets or sets the transformation matrix.
public XMatrix Transform { get; set; }
Gets or sets a flag indicating whether image interpolation is to be performed.
public bool Interpolate { get; set; }
Gets the format of the image.
public XImageFormat Format { get; }
Initializes a new instance of the XForm class that represents a page of a PDF document.
public XForm(PdfDocument document, XRect viewBox)
document
PdfDocument
The PDF document.
viewBox
XRect
The view box of the page.
Initializes a new instance of the XForm class that represents a page of a PDF document.
public XForm(PdfDocument document, XSize size)
document
PdfDocument
The PDF document.
size
XSize
The size of the page.
Initializes a new instance of the XForm class that represents a page of a PDF document.
public XForm(PdfDocument document, XUnit width, XUnit height)
document
PdfDocument
The PDF document.
width
XUnit
The width of the page.
height
XUnit
The height of the page
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()
Called from XGraphics constructor that creates an instance that work on this form.
internal void AssociateGraphics(XGraphics gfx)
gfx
XGraphics
Disposes this instance.
protected void Dispose(bool disposing)
disposing
Boolean
Sets the form in the state FormState.Finished.
internal void Finish()
Gets the resource name of the specified font within this form.
internal string GetFontName(XFont font, PdfFont& pdfFont)
font
XFont
pdfFont
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)
idName
String
pdfFont
PdfFont&
Gets the resource name of the specified font data within this form.
internal string GetFontName(string idName, Byte[] fontData, PdfFont& pdfFont)
idName
String
fontData
Byte[]
pdfFont
PdfFont&
Gets the resource name of the specified image within this form.
internal string GetImageName(XImage image)
image
XImage
Gets the resource name of the specified form within this form.
internal string GetFormName(XForm form)
form
XForm