Options
All
  • Public
  • Public/Protected
  • All
Menu

Class of optional PDF options. The properties of this class define all possible PDF output options. All of them are optional, which is why passing an instance of this class in an OutputConfig is also optional.

Hierarchy

  • PDFOptions

Index

Constructors

constructor

  • new PDFOptions(readPassword?: string, watermark?: string, pageWidth?: string | number, pageHeight?: string | number, evenPage?: boolean, mergeMakingEven?: boolean, modifyPassword?: string, passwordProtectionFlag?: number, lockForm?: boolean, copies?: number, pageMargin?: number | {}, landscape?: boolean, pageFormat?: string, merge?: boolean, signCertificate?: string, identifyFormFields?: boolean, split?: boolean): PDFOptions
  • Parameters

    • Optional readPassword: string

      The password needed to open the PDF. Optional.

    • Optional watermark: string

      Setting this generates a diagonal custom watermark on every page in the PDF file. Optional.

    • Optional pageWidth: string | number

      Only for HTML to PDF. Page width in px, mm, cm, in. No unit means px. Optional.

    • Optional pageHeight: string | number

      Only for HTML to PDF. Page height in px, mm, cm, in. No unit means px. Optional.

    • Optional evenPage: boolean

      If you want your output to have even pages, for example printing on both sides after merging, you can set this to be true. Optional.

    • Optional mergeMakingEven: boolean

      Merge each given document making even paged. Optional.

    • Optional modifyPassword: string

      The password needed to modify the PDF. Optional.

    • Optional passwordProtectionFlag: number

      Bit field explained in the PDF specs in table 3.20 in section 3.5.2, should be given as an integer. More info. Optional.

    • Optional lockForm: boolean

      Locks / flattens the forms in the PDF. Optional.

    • Optional copies: number

      Repeats the output pdf for the given number of times. Optional.

    • Optional pageMargin: number | {}

      Only for HTML to PDF. Margin in px. Returns either a dict containing: { 'top': int, 'bottom': int, 'left': int, 'right': int } or just an int to be used on all sides. Optional.

    • Optional landscape: boolean

      Only for HTML to PDF. If True: the orientation of the output file is landscape; else portrait (default). Optional.

    • Optional pageFormat: string

      Only for HTML to PDF. The page format: 'a4' (default) or 'letter'. Optional.

    • Optional merge: boolean

      If True: instead of returning back a zip file for multiple output, merge it. Optional.

    • Optional signCertificate: string

      Signing certificate for the output PDF (pkcs #12 .p12/.pfx) as a base64 string, URL, FTP location or a server path. The function readFileAsBase64() from file_utils.ts can be used to read local .p12 or .pfx file as base64. Optional.

    • Optional identifyFormFields: boolean

      Identify the form fields in a PDF-form by filling the name of each field into the respective field. Optional.

    • Optional split: boolean

      You can specify to split a PDF in separate files. You will get one file per page in a zip file. Optional.

    Returns PDFOptions

Properties

copies

copies: undefined | number

evenPage

evenPage: undefined | boolean

identifyFormFields

identifyFormFields: undefined | boolean

landscape

landscape: undefined | boolean

lockForm

lockForm: undefined | boolean

merge

merge: undefined | boolean

mergeMakingEven

mergeMakingEven: undefined | boolean

modifyPassword

modifyPassword: undefined | string

pageFormat

pageFormat: undefined | string

pageHeight

pageHeight: undefined | string | number

pageMargin

pageMargin: undefined | number | {}

pageWidth

pageWidth: undefined | string | number

passwordProtectionFlag

passwordProtectionFlag: undefined | number

readPassword

readPassword: undefined | string

signCertificate

signCertificate: undefined | string

split

split: undefined | boolean

watermark

watermark: undefined | string

Methods

asDict

  • asDict(): {}
  • The dict representation of these PDF options.

    Returns {}

    the dict representation of these PDF options

    • [key: string]: string | number | boolean | {}

pageOrientation

  • pageOrientation(): string
  • The page orientation, portrait or landscape.

    Returns string

    The page orientation, portrait or landscape.

setPageMarginAt

  • setPageMarginAt(value: number, position?: string): void
  • Set page margin. Either set the position for all margin positions (if position is None) or set a specific one.

    Parameters

    • value: number

      page margin in px

    • Optional position: string

      'all', 'top', 'bottom', 'left' or 'right'; optional

    Returns void

setPageOrientation

  • setPageOrientation(value: string): void
  • Setter for the page orientation.

    Parameters

    • value: string

      the page orientation

    Returns void

Generated using TypeDoc