Skip to content

PdfForm class

View as Markdown

Namespace: PdfNetStack.Drawing
Assembly: PdfNetStack.dll
Package: PdfNetStack

A reusable drawing (a form XObject, ISO 32000-1, 8.10): drawn once, placed any number of times with DrawForm. Use it for stamps, letterheads and repeated logos, or with FromPage to place a page of any document, scaled and positioned, on another page.

public sealed class PdfForm

Inheritance

object ← PdfForm

The document the form belongs to.

public PdfDocument Document { get; }

PdfDocument

Height in points.

public double Height { get; }

double

Width in points.

public double Width { get; }

double

An empty form to draw into with CreateGraphics.

public static PdfForm Create(PdfDocument document, double width, double height)

document PdfDocument

width double

height double

PdfForm

A canvas on the form, top left origin, in points. Dispose it to write the drawing.

public PdfGraphics CreateGraphics()

PdfGraphics

A form showing a page’s visible area (its crop box), upright as the page’s rotation shows it. The page may belong to another document; its fonts and images are copied over. Annotations are not part of the page’s content and are not included.

public static PdfForm FromPage(PdfDocument document, PdfPage page)

document PdfDocument

page PdfPage

PdfForm

InvalidOperationException

The page’s document does not permit copying its content.