Slides Print
| Packages | @univerjs-pro/slides-print |
|---|
Facade API for printing Univer Slides presentations.
Import
@univerjs-pro/slides-print/facadebefore using this API in plugin mode.
Overview
univerAPI
| Method | Signature |
|---|---|
printSlidesAsync | printSlidesAsync(options?: ISlidePrintOptions): Promise<boolean> |
openSlidesPrintDialog | openSlidesPrintDialog(options?: ISlidePrintOptions): boolean |
APIs
printSlidesAsync
Open the browser print dialog for the active presentation.
Signature
TypeScript
printSlidesAsync(options?: ISlidePrintOptions): Promise<boolean>Parameters
optionsISlidePrintOptions(optional) — Print options.rangeaccepts 1-based page ranges. Overlapping ranges are de-duped and printed in the original slide order.
Returns
Promise\<boolean\>— Whether the print operation was started.
Examples
TypeScript
await univerAPI.printSlidesAsync()await univerAPI.printSlidesAsync({ range: [{ from: 1, to: 3 }], layout: univerAPI.Enum.SlidePrintLayoutType.Handout, slidesPerPage: 6, handoutOrder: univerAPI.Enum.SlidePrintHandoutOrder.Horizontal, frameSlides: true, showSlideNumber: true,})openSlidesPrintDialog
Open Univer's Slides print settings and preview UI.
TypeScript
openSlidesPrintDialog(options?: ISlidePrintOptions): booleanISlidePrintOptions also accepts paperSize, direction, margin, and marginCustom. Layouts are FullPage, Handout, and NotesPage; handouts support 1, 2, 3, 4, 6, or 9 slides per page.
@univerjs-pro/slides-printHow is this guide?