Skip to main content
@reductoai/xlsx/view paints a workbook on a canvas in the browser: cells, merged cells, conditional formats, charts, pictures, frozen panes and the sheet tabs.
Install the drawing host once, before the first view. portableFaceProvider loads the portable fonts from the URL you give for each file; copy node_modules/@reductoai/portable-fonts/files to your site (see Fonts).

Options

Edits from code

After you change the workbook from code, call view.refresh().
Call view.destroy() when you remove the element.

Picture of a range

view.rangeImage(range, options) returns a PNG Blob of a range, as Excel’s Copy Picture shows it. It does not show the selection, and it shows headers and gridlines only when you ask (labels, gridlines). With no range, the picture shows the selected cells.
In the editor, the view is editor.model.view. See PNG for the options and limits.
For a full spreadsheet UI with the Home tab, menus and windows, use @reductoai/xlsx-editor instead. It sets up the fonts for you.