Docs › Saving and output
Preview and print
Preview at phone, tablet and desktop width; print just the post.
The preview button shows the saved HTML the way readers will see it, at phone, tablet or desktop width, so you can check how images and tables fit. The print button prints just the post, without the toolbar.
Try it
Opening hours
| Days | Opens | Closes | Note |
|---|---|---|---|
| Mon-Fri | 9 am | 9 pm | Lunch 12-1 |
| Sat | 10 am | 6 pm | - |
Code for this demo
createEditor('#editor', {
toolbar: 'heading | bold | image table | preview print',
height: 300,
});Preview
- Pick Phone (360px), Tablet (768px) or Desktop (full width). It opens at Desktop.
- It shows the
getHTML()output, with the saved HTML extras such as fitted images and sideways-scrolling tables. - The toolbar item is
preview, in the ⋯ menu of theboard(default) andfullpresets.
- The
getHTML()output goes into a hidden frame with a small print stylesheet, and the browser print dialog opens. No toolbar or editor border is printed. - A page break (
pageBreak) starts a new sheet. - Checklists print as ☐ / ☑.
- The toolbar item is
print; only thefullpreset has it (in the ⋯ menu). Add it totoolbaryourself elsewhere.
Both work in read-only mode and while the source view is open. From code, call editor.exec('preview') or editor.exec('print').
Options
| Name | Type | Default | Description |
|---|---|---|---|
preview | toolbar item | - | Preview dialog at phone, tablet or desktop width |
print | toolbar item | - | Print the post only |
exec('preview') | method | - | Open the preview from code |
exec('print') | method | - | Open the print dialog from code |