[]
        
(Showing Draft Content)

GrapeCity.Documents.Html.PdfOptions

Class PdfOptions

Namespace
GrapeCity.Documents.Html
Assembly
GcDocs.Html.dll

Represents output settings for rendering HTML to PDF.

public class PdfOptions
Inheritance
object
PdfOptions
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

PdfOptions()

public PdfOptions()

Properties

DisplayHeaderFooter

Gets or sets a value indicating whether the header and footer are rendered. Defaults to false.

Note that this property is ignored if FullPage is true.

public bool DisplayHeaderFooter { get; set; }

Property Value

bool

FooterTemplate

Gets or sets the HTML template for the page footer.

This should be a valid HTML markup that may include the following special classes used to inject print values:

  • 'date'formatted print date
  • 'title'document title
  • 'url'document location
  • 'pageNumber'current page number
  • 'totalPages'total pages in the document

For example, "<span class='title'></span>" would generate a span containing the document title.

public string FooterTemplate { get; set; }

Property Value

string

FullPage

Gets or sets a value indicating whether the whole HTML page should be rendered as a single PDF page. Defaults to false.

Note that if this property is true, the following properties are ignored: Landscape, PageWidth, PageHeight, PreferCSSPageSize, Margins, PageRanges, DisplayHeaderFooter, HeaderTemplate and FooterTemplate.

public bool FullPage { get; set; }

Property Value

bool

HeaderTemplate

Gets or sets the HTML template for the page header.

This should be a valid HTML markup that may include the following special classes used to inject print values:

  • 'date'formatted print date
  • 'title'document title
  • 'url'document location
  • 'pageNumber'current page number
  • 'totalPages'total pages in the document

For example, "<span class='title'></span>" would generate a span containing the document title.

public string HeaderTemplate { get; set; }

Property Value

string

Landscape

Gets or sets a value indicating whether the paper orientation is Landscape. Defaults to false.

Note that this property is ignored if FullPage is true.

public bool Landscape { get; set; }

Property Value

bool

Margins

Gets or sets page margins, in inches. Defaults to no margins.

Note that this property is ignored if FullPage is true.

public PdfMargins Margins { get; set; }

Property Value

PdfMargins

PageHeight

Gets or sets the page height, in inches. If unspecified, 11 inches is used.

Note that this property is ignored if FullPage is true.

public float? PageHeight { get; set; }

Property Value

float?

PageRanges

Gets or sets the range of pages to render, e.g., '1-5, 8, 11-13'. Defaults to all pages.

Note that this property is ignored if FullPage is true.

public string PageRanges { get; set; }

Property Value

string

PageWidth

Gets or sets the page width, in inches. If unspecified, 8.5 inches is used.

Note that this property is ignored if FullPage is true.

public float? PageWidth { get; set; }

Property Value

float?

PreferCSSPageSize

Gets or sets a value indicating whether the CSS-defined page size should have priority over what is declared in PageWidth and PageHeight. Defaults to false.

public bool PreferCSSPageSize { get; set; }

Property Value

bool

PrintBackground

Gets or sets a value indicating whether to print background graphics. Defaults to true.

public bool PrintBackground { get; set; }

Property Value

bool

Scale

Gets or sets the scale factor between 0.1 and 2.0. Defaults to 1.0.

public float Scale { get; set; }

Property Value

float