Convert PDFs to MS Office (DOCX, XLSX, PPTX) without any external third party dependencies. PDF to Word, PDF to Excel, PDF to PowerPoint are all provided with support for C#, Python, C++, Java, PHP, Ruby, Go; on Windows, Linux and Mac.
The Structured Output module is an optional add-on Only available on Desktop and Server (Windows, Linux, or Mac) You can find more details about how to install the Structured Output module here .
Download the Structured Output Module that allows PDF to Office conversion. Place it in the directory of your project, in a folder called lib
and then reference it in the below sample. This sample demonstrates how to convert from a PDF to DOCX file.
C# C++ Go Java JavaScript PHP Python Ruby VB
1 Convert . WordOutputOptions wordOutputOptions = new Convert . WordOutputOptions ();
2 // Optionally convert only the first page
3 wordOutputOptions. SetPages ( 1 , 1 );
4 // Requires the Structured Output module
5 Convert. ToWord (filename, output_filename, wordOutputOptions);
1 Convert :: WordOutputOptions wordOutputOptions;
2 // Optionally convert only the first page
3 wordOutputOptions. SetPages ( 1 , 1 );
4 // Requires the Structured Output module
5 Convert :: ToWord (filename, output_filename, wordOutputOptions);
1 wordOutputOptions := NewWordOutputOptions ()
2 // Optionally convert only the first page
3 wordOutputOptions. SetPages ( 1 , 1 )
4 // Requires the Structured Output module
5 ConvertToWord (filename, output_filename, wordOutputOptions)
1 Convert . WordOutputOptions wordOutputOptions = new Convert. WordOutputOptions ();
2 // Optionally convert only the first page
3 wordOutputOptions. setPages ( 1 , 1 );
4 // Requires the Structured Output module
5 Convert. toWord (filename, output_filename, wordOutputOptions);
1 const { PDFNet } = require ( ' @pdftron/pdfnet-node ' );
2 async function main () {
3 await PDFNet. addResourceSearchPath ( ' ./lib/ ' );
4 // check if the module is available
5 if ( ! ( await PDFNet.StructuredOutputModule. isModuleAvailable ())) {
6 return ;
7 }
8 await PDFNet.Convert. fileToWord ( ' ./input.pdf ' , ' output.docx ' );
9 }
10 PDFNet. runWithCleanup (main, ' YOUR_LICENSE_KEY ' );
1 $wordOutputOptions = new WordOutputOptions ();
2 // Optionally convert only the first page
3 $wordOutputOptions -> SetPages ( 1 , 1 );
4 // Requires the Structured Output module
5 Convert :: ToWord ($filename, $output_filename, wordOutputOptions );
1 wordOutputOptions = WordOutputOptions()
2 # Optionally convert only the first page
3 wordOutputOptions.SetPages( 1 , 1 )
4 # Requires the Structured Output module
5 Convert.ToWord(filename, output_filename, wordOutputOptions)
1 $wordOutputOptions = Convert :: WordOutputOptions . new ()
2 # Optionally convert only the first page
3 $wordOutputOptions. SetPages ( 1 , 1 );
4 # Requires the Structured Output module
5 Convert .toWord(filename, output_filename, $wordOutputOptions)
1 Dim wordOutputOptions As pdftron .PDF. Convert .WordOutputOptions = New pdftron.PDF. Convert . WordOutputOptions ()
2 ' Optionally convert only the first page
3 wordOutputOptions. SetPages ( 1 , 1 )
4 ' Requires the Structured Output module
5 Convert . ToWord (filename, output_filename, wordOutputOptions)
This sample demonstrates how to convert from a PDF to PPTX file.
C# C++ Go Java JavaScript PHP Python Ruby VB
1 Convert . PowerPointOutputOptions powerPointOutputOptions = new Convert . PowerPointOutputOptions ();
2 // Optionally convert only the first page
3 powerPointOutputOptions. SetPages ( 1 , 1 );
4 // Requires the Structured Output module
5 Convert. ToPowerPoint (filename, output_filename, powerPointOutputOptions);
1 Convert :: PowerPointOutputOptions powerPointOutputOptions;
2 // Optionally convert only the first page
3 powerPointOutputOptions. SetPages ( 1 , 1 );
4 // Requires the Structured Output module
5 Convert :: ToPowerPoint (filename, output_filename, powerPointOutputOptions);
1 powerPointOutputOptions := NewPowerPointOutputOptions ()
2 // Optionally convert only the first page
3 powerPointOutputOptions. SetPages ( 1 , 1 )
4 // Requires the Structured Output module
5 ConvertToPowerPoint (filename, output_filename, powerPointOutputOptions)
1 Convert . PowerPointOutputOptions powerPointOutputOptions = new Convert. PowerPointOutputOptions ();
2 // Optionally convert only the first page
3 powerPointOutputOptions. setPages ( 1 , 1 );
4 // Requires the Structured Output module
5 Convert. toPowerPoint (filename, output_filename, powerPointOutputOptions);
1 const { PDFNet } = require ( ' @pdftron/pdfnet-node ' );
2 async function main () {
3 await PDFNet. addResourceSearchPath ( ' ./lib/ ' );
4 // check if the module is available
5 if ( ! ( await PDFNet.StructuredOutputModule. isModuleAvailable ())) {
6 return ;
7 }
8 await PDFNet.Convert. fileToPowerPoint ( ' ./input.pdf ' , ' output.pptx ' );
9 }
10 PDFNet. runWithCleanup (main, ' YOUR_LICENSE_KEY ' );
1 $powerPointOutputOptions = new PowerPointOutputOptions ();
2 // Optionally convert only the first page
3 $powerPointOutputOptions -> SetPages ( 1 , 1 );
4 // Requires the Structured Output module
5 Convert :: ToPowerPoint ($filename, $output_filename, powerPointOutputOptions );
1 powerPointOutputOptions = PowerPointOutputOptions()
2 # Optionally convert only the first page
3 powerPointOutputOptions.SetPages( 1 , 1 )
4 # Requires the Structured Output module
5 Convert.ToPowerPoint(filename, output_filename, powerPointOutputOptions)
1 $powerPointOutputOptions = Convert :: PowerPointOutputOptions . new ()
2 # Optionally convert only the first page
3 $powerPointOutputOptions. SetPages ( 1 , 1 );
4 # Requires the Structured Output module
5 Convert .toPowerPoint(filename, output_filename, $powerPointOutputOptions)
1 Dim powerPointOutputOptions As pdftron .PDF. Convert .PowerPointOutputOptions = New pdftron.PDF. Convert . PowerPointOutputOptions ()
2 ' Optionally convert only the first page
3 powerPointOutputOptions. SetPages ( 1 , 1 )
4 ' Requires the Structured Output module
5 Convert . ToPowerPoint (filename, output_filename, powerPointOutputOptions)
This sample demonstrates how to convert from a PDF to XLSX file.
C# C++ Go Java JavaScript PHP Python Ruby VB
1 Convert . ExcelOutputOptions excelOutputOptions = new Convert . ExcelOutputOptions ();
2 // Optionally convert only the first page
3 excelOutputOptions. SetPages ( 1 , 1 );
4 // Requires the Structured Output module
5 Convert. ToExcel (filename, output_filename, excelOutputOptions);
1 Convert :: ExcelOutputOptions excelOutputOptions;
2 // Optionally convert only the first page
3 excelOutputOptions. SetPages ( 1 , 1 );
4 // Requires the Structured Output module
5 Convert :: ToExcel (filename, output_filename, excelOutputOptions);
1 excelOutputOptions := NewExcelOutputOptions ()
2 // Optionally convert only the first page
3 excelOutputOptions. SetPages ( 1 , 1 )
4 // Requires the Structured Output module
5 ConvertToExcel (filename, output_filename, excelOutputOptions)
1 Convert . ExcelOutputOptions excelOutputOptions = new Convert. ExcelOutputOptions ();
2 // Optionally convert only the first page
3 excelOutputOptions. setPages ( 1 , 1 );
4 // Requires the Structured Output module
5 Convert. toExcel (filename, output_filename, excelOutputOptions);
1 const { PDFNet } = require ( ' @pdftron/pdfnet-node ' );
2 async function main () {
3 await PDFNet. addResourceSearchPath ( ' ./lib/ ' );
4 // check if the module is available
5 if ( ! ( await PDFNet.StructuredOutputModule. isModuleAvailable ())) {
6 return ;
7 }
8 await PDFNet.Convert. fileToExcel ( ' ./input.pdf ' , ' output.xlsx ' );
9 }
10 PDFNet. runWithCleanup (main, ' YOUR_LICENSE_KEY ' );
1 $excelOutputOptions = new ExcelOutputOptions ();
2 // Optionally convert only the first page
3 $excelOutputOptions -> SetPages ( 1 , 1 );
4 // Requires the Structured Output module
5 Convert :: ToExcel ($filename, $output_filename, excelOutputOptions );
1 excelOutputOptions = ExcelOutputOptions()
2 # Optionally convert only the first page
3 excelOutputOptions.SetPages( 1 , 1 )
4 # Requires the Structured Output module
5 Convert.ToExcel(filename, output_filename, excelOutputOptions)
1 $excelOutputOptions = Convert :: ExcelOutputOptions . new ()
2 # Optionally convert only the first page
3 $excelOutputOptions. SetPages ( 1 , 1 );
4 # Requires the Structured Output module
5 Convert .toExcel(filename, output_filename, $excelOutputOptions)
1 Dim excelOutputOptions As pdftron .PDF. Convert .ExcelOutputOptions = New pdftron.PDF. Convert . ExcelOutputOptions ()
2 ' Optionally convert only the first page
3 excelOutputOptions. SetPages ( 1 , 1 )
4 ' Requires the Structured Output module
5 Convert . ToExcel (filename, output_filename, excelOutputOptions)
Convert PDF files to MS Office Full sample code which illustrates how to convert PDF to MS Office files (Word, Excel, PowerPoint).