Skip to content
ComPDF

Convert PDF to Excel

Overview

ComPDF Conversion SDK supports converting PDF documents to Microsoft Excel format (.xlsx). By extracting, parsing, and importing data from PDF into Excel, users can further edit, analyze, or share Excel files. This feature helps increase productivity, reduce manual entry errors, and simplify complex document processing tasks.

Set the content options for Excel

When converting PDF files to Excel files, you need to pay attention to the settings of the following options, which will directly affect the content written to the Excel file.

  • Content options:

    If you set the all_content option, the converted XLSX file will contain all content in the PDF.

  • Worksheet options:

OptionDescription
FOR_TABLECreate one sheet per table.
FOR_PAGECreate one sheet per page.
FOR_DOCUMENTCreate one sheet for the entire document.

Sample

This sample demonstrates how to convert from a PDF to XLSX file.

python
input_file_path = "***"
password = "***"
output_file_name = "***"

excel_options = ConvertOptions()
error = CPDFConversion.start_pdf_to_excel(input_file_path, password, output_file_name, excel_options)