Web SDKv1.0.0

PDFViewer.print()

Ask for pages and annotations (or take them from options), render at 300 DPI (within performance.maxRenderPixels) with progress, and open the browser print dialog. Needs the print feature.
methodExport and printsince 1.0.0

Signature

print(options?: PrintOptions): Promise<void>

Parameters

ParameterTypeDescription
options?PrintOptions{ pages?: number[]; annotations?: boolean } — the pages to print (zero-based; every page when omitted) and whether annotations are printed (true when omitted). Without it the viewer asks for pages and annotations.

Returns

Promise<void> Resolves when the browser reports the print dialog closed (afterprint), or after a minute where it never does.

Throws

  • INVALID_ARGUMENT for a pages list that is empty or names a page the document has not.
  • FEATURE_NOT_LICENSED without the print feature.
  • PERMISSION_DENIED when the document forbids printing.
  • INVALID_STATE after destroy().

Example

TypeScript
await viewer.print({ pages: [0, 1], annotations: false });

More in PDFViewer