Table of Contents

Class XPdfForm

Namespace
PdfSharp.Drawing
Assembly
PdfSharp.dll

Represents a so called 'PDF form external object', which is typically an imported page of an external PDF document. XPdfForm objects are used like images to draw an existing PDF page of an external document in the current document. XPdfForm objects can only be placed in PDF documents. If you try to draw them using a XGraphics based on an GDI+ context no action is taken if no placeholder image is specified. Otherwise, the placeholder is drawn.

public class XPdfForm : XForm
Inheritance
object
XPdfForm
Inherited Members

Properties

Page

Gets the underlying PdfPage (if one exists).

PageCount

Gets the number of pages in the PDF form.

PageIndex

Gets or sets the page index in the external PDF document this object refers to. The page index is zero-based, i.e. it is in the range from 0 to PageCount - 1. The default value is 0.

PageNumber

Gets or sets the page number in the external PDF document this object refers to. The page number is one-based, i.e. it is in the range from 1 to PageCount. The default value is 1.

PixelHeight

Gets the height in point of the page identified by the property PageNumber.

PixelWidth

Gets the width in point of the page identified by the property PageNumber.

PlaceHolder

Gets or sets an image that is used for drawing if the current XGraphics object cannot handle PDF forms. A place holder is useful for showing a preview of a page on the display, because PDFsharp cannot render native PDF objects.

PointHeight

Gets the height in point of the page identified by the property PageNumber.

PointWidth

Gets the width in point of the page identified by the property PageNumber.

Size

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

Transform

Gets or sets the transformation matrix.

Methods

Dispose(bool)

Frees the memory occupied by the underlying imported PDF document, even if other XPdfForm objects refer to this document. A reuse of this object doesn’t fail, because the underlying PDF document is re-imported if necessary.

ExtractPageNumber(string, out int)

Extracts the page number if the path has the form 'MyFile.pdf#123' and returns the actual path without the number sign and the following digits.

FromFile(string)

Creates an XPdfForm from a file.

FromStream(Stream)

Creates an XPdfForm from a stream.