Options
All
  • Public
  • Public/Protected
  • All
Menu

the new options for rendering PDF's using our Chrome backend. If you are using the old WebKit backend, see IPdfOptions_WebKit

Note: by default PDF's use the CSS @screen media type. to change this, set IRenderSettings.emulateMedia to a value such as print

If you want to rename the file (used if the user saves the pdf) set the Content-Disposition header via IRenderSettings.extraResponseHeaders. For example: "Content-Disposition":'attachment; filename="downloaded.pdf"'

Hierarchy

  • IPdfOptions

Index

Properties

Optional footerTemplate

footerTemplate: string

a HTML template, use the following classes to inject print values into their respective elements: date, title, url, pageNumber, totalPages

If the associated margin is not explicitly set, setting a template will automatically set the margin to "1in"

Note: page css is not available to this template, so include inline-css for styling.

example

<span style='font-size: 15px; height: 200px; background-color: black; color: white; margin: 20px;'>Header or Footer. <span style='font-size: 10px;'>Keep templates simple, and inline CSS. Page:<span class='pageNumber'>XX</span>/<span class='totalPages'>YY</span></span></span>

Optional format

format: string

standard paper size to use. Supported options are Letter, Legal, Tabloid, Ledger, and A0 to A6

default

"Letter"

Optional headerTemplate

headerTemplate: string

a HTML template, use the following CSS classes to inject print values into their respective elements: date, title, url, pageNumber, totalPages

alternatively, you could pass the special classes as variables, as shown in this example: <span>Page %pageNumber% of %totalPages%</span>

If the associated margin is not explicitly set, setting a template will automatically set the margin to "1in"

Note: page css is not available to this template, so include inline-css for styling.

example

<span style='font-size: 15px; height: 200px; background-color: black; color: white; margin: 20px;'>Header or Footer. <span style='font-size: 10px;'>Keep templates simple, and inline CSS. Page:<span class='pageNumber'>XX</span>/<span class='totalPages'>YY</span></span></span>

Optional height

height: string

optional dimensions used if you don't specify format.

pass a number with one of the following units: px, in, cm, or mm.

example

"88cm"

Optional landscape

landscape: boolean

Optional margin

margin: object

optional margin use units such as those used for width or height properties

default

no margin.

Type declaration

  • Optional bottom?: string
  • Optional left?: string
  • Optional right?: string
  • Optional top?: string

Optional pageRanges

pageRanges: string

Paper ranges to print, e.g., '1-5, 8, 11-13'.

Optional preferCSSPageSize

preferCSSPageSize: boolean

if set to true, will use the CSS @page size if any is present.

Optional width

width: string

optional dimensions used if you don't specify format.

pass a number with one of the following units: px, in, cm, or mm.

example

"88cm"