Example
const officeDocument = await fetch('example.xlsx').then(response => response.arrayBuffer())
NutrientViewer.convertToPDF(file, null, {
splitExcelSheetsIntoPages: true,
spreadsheetMaximumContentHeightPerSheet: 1000,
spreadsheetMaximumContentWidthPerSheet: 50,
})
const officeDocument = await fetch('example.docx').then(response => response.arrayBuffer())
NutrientViewer.convertToPDF(file, null, {
documentMarkupMode: 'original',
})
Default Value
{ splitExcelSheetsIntoPages: false, spreadsheetRenderOnlyPrintArea: true, documentMarkupMode: 'noMarkup' }Properties
documentMarkupMode
Optional
"noMarkup" | "original" | "simpleMarkup" | "allMarkup"
splitExcelSheetsIntoPages
Optional
boolean
If true, each sheet in the Excel document will be exported as a separate page in the PDF.
number
The maximum height of the content in a single sheet. If the content exceeds this height, it will be split into multiple pages.
number
The maximum width of the content in a single sheet. If the content exceeds this width, it will be split into multiple pages.
spreadsheetRenderOnlyPrintArea
Optional
boolean
If true, only the print area of spreadsheet sheets will be rendered. If no print area is defined, the entire sheet is rendered.
*** Standalone Only ***
Options for exporting the document to PDF from an office format.
Some properties are only used when exporting specific Office formats, such as XLSX or DOCX.