Some test text!

Loading...
Guides
Convert MS Office to PDF

Convert MS Office (Word, Excel, PowerPoint) to PDF using JavaScript

To convert an MS Office file to a PDF document without any external third party dependencies.

<html>
  <body>
    <script src="../lib/core/webviewer-core.min.js"></script>
    <script src="../FileSaver.min.js">/* https://github.com/eligrey/FileSaver.js */</script>
    <script>
    (async function() {
      Core.setWorkerPath('../lib/core');
      const licenseKey = 'Insert commercial license key here after purchase';
      await PDFNet.initialize();

      // perform the conversion with no optional parameters
      const buf = await Core.office2PDFBuffer('/path/to/file.docx', { l: licenseKey });

      //optionally save the blob to a file or upload to a server
      const blob = new Blob([buf], { type: 'application/pdf' });
    })()
    </script>
  </body>
</html>

Additional font resources

WebViewer will automatically use substitute fonts hosted on a web server when a font is not embedded in the source document. The fallback fonts are hosted with PDFTron by default but if this is a concern, you can host the fonts on your own servers. See this FAQ for more details.

Get the answers you need: Support