Some test text!
Nodejs / Guides / Convert PDF to MS Office
Platform
Documentation
Convert PDFs to MS Office (DOCX, XLSX, PPTX) without any external third party dependencies.
lib
and then reference it in the below sample.This sample demonstrates how to convert from a PDF to DOCX file.
const { PDFNet } = require('@pdftron/pdfnet-node');
async function main() {
await PDFNet.addResourceSearchPath('./lib/');
// check if the module is available
if (!(await PDFNet.StructuredOutputModule.isModuleAvailable())) {
return;
}
await PDFNet.Convert.fileToWord('./input.pdf', 'output.docx');
}
PDFNet.runWithCleanup(main, 'YOUR_LICENSE_KEY');
This sample demonstrates how to convert from a PDF to PPTX file.
const { PDFNet } = require('@pdftron/pdfnet-node');
async function main() {
await PDFNet.addResourceSearchPath('./lib/');
// check if the module is available
if (!(await PDFNet.StructuredOutputModule.isModuleAvailable())) {
return;
}
await PDFNet.Convert.fileToPowerPoint('./input.pdf', 'output.pptx');
}
PDFNet.runWithCleanup(main, 'YOUR_LICENSE_KEY');
This sample demonstrates how to convert from a PDF to XLSX file.
const { PDFNet } = require('@pdftron/pdfnet-node');
async function main() {
await PDFNet.addResourceSearchPath('./lib/');
// check if the module is available
if (!(await PDFNet.StructuredOutputModule.isModuleAvailable())) {
return;
}
await PDFNet.Convert.fileToExcel('./input.pdf', 'output.xlsx');
}
PDFNet.runWithCleanup(main, 'YOUR_LICENSE_KEY');
Convert PDF files to MS Office
Full sample code which illustrates how to convert PDF to MS Office files (Word, Excel, PowerPoint).
Get the answers you need: Support