Click or drag to resize
Pdf Library for .NET

PdfPageMargins Property

Gets the pdf page margins. Read-only.

Namespace: SelectPdf.Universal
Assembly: SelectPdf.HtmlToPdf.Universal (in SelectPdf.HtmlToPdf.Universal.dll) Version: 26.4
Syntax
public PdfMargins Margins { get; }

Property Value

PdfMargins
Remarks
Resolved per document origin:
  • New docs, pages created via Add(PdfCustomPageSize, PdfMargins, PdfPageOrientation): returns the margins passed at Add time, or the document default in effect at that moment if none were specified.
  • HtmlToPdf output: returns the converter-assigned margins from MarginLeft / MarginTop / MarginRight / MarginBottom.
  • Loaded docs: computed as MediaBox minus CropBox. Returns zeros when the source PDF did not define a CropBox (it then defaults to MediaBox).
The property is get-only by design — to render content with specific margins on a new page, pass them to AddPage.
See Also