Converts a file to a PDF.
Returns a https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise|Promise resolving to an ArrayBuffer of a PDF, or rejecting with a NutrientViewer.Error.
ArrayBuffer
The resulting ArrayBuffer can be directly loaded with ().
It requires a configuration object. If the configuration is invalid, the promise will be rejected with a NutrientViewer.Error.
A configuration Object
Optional
A conformance level of the output PDF
Settings specific to office conversion
Promise that resolves to an ArrayBuffer of a file converted to PDF
NutrientViewer.convertToPDF({ document: "/sales-report.docx", licenseKey: "YOUR_LICENSE_KEY",}).then((arrayBuffer) => { console.log("Successfully converted document", arrayBuffer);}).catch((error) => { console.error(error.message);})@public Copy
NutrientViewer.convertToPDF({ document: "/sales-report.docx", licenseKey: "YOUR_LICENSE_KEY",}).then((arrayBuffer) => { console.log("Successfully converted document", arrayBuffer);}).catch((error) => { console.error(error.message);})@public
Converts a file to a PDF.
Returns a https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise|Promise resolving to an
ArrayBufferof a PDF, or rejecting with a NutrientViewer.Error.The resulting
ArrayBuffercan be directly loaded with ().It requires a configuration object. If the configuration is invalid, the promise will be rejected with a NutrientViewer.Error.