Copy

html2pdf

Creates an html2pdf.js-compatible PDF chain.

ON_THIS_PAGE
  1. Signature
  2. Parameters
  3. Returns
  4. Example

Creates an html2pdf.js-compatible PDF chain.

Passing a source directly preserves html2pdf.js shorthand behavior and also schedules save. Call without a source when composing an explicit chain.

Signature

export declare function html2pdf(source?: HtmlSource, options?: Html2PdfOptions): CompatWorker;
SOURCE:228

Parameters

ParameterTypeRequiredDefaultDescription
sourceHtmlSourceNoNoneHTML string, mounted element, or ref-shaped value to render.
optionsHtml2PdfOptionsNoNoneOptions for this operation.

Returns

CompatWorker

Example

await html2pdf()
  .set({ filename: "invoice.pdf", margin: [10, 12] })
  .from(element)
  .save();
ON_THIS_PAGE
  1. Signature
  2. Parameters
  3. Returns
  4. Example
html2realpdf documentationCopyright © Imggion
DOCUMENTATION_TREE