Some test text!

menu
Convert MS Office to PDFkeyboard_arrow_down

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/CoreControls.js"></script>
    <script src="../FileSaver.min.js">/* https://github.com/eligrey/FileSaver.js */</script>
    <script>
    (async function() {
      CoreControls.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 CoreControls.office2PDFBuffer('/path/to/file.docx', { l: licenseKey });

      // optionally save the document to the filesystem
      saveAs(new Blob([buf], {type: 'application/pdf'}), output_filename);
    })()
    </script>
  </body>
</html>

Convert MS Office files to PDF
Full sample code which illustrates how to convert MS Office files (Word, Excel, PowerPoint) to PDF.

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

Join our live demo to learn about use cases & capabilities for WebViewer

Learn more
close