Skip to content
DemoFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

PDF to Excel — C ​

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.

Excel Options ​

When converting PDF files to Excel files, pay attention to the following options:

  • excel_all_content: If enabled, the converted XLSX file contains all content in the PDF.
  • excel_worksheet_option: Controls how worksheets are created.
OptionDescription
e_CForTableCreate one sheet for one table.
e_CForPageCreate one sheet for one PDF page.
e_CForDocumentCreate one sheet for the entire PDF document.

Sample ​

c
CConvertOption option = CPDF_DefaultConvertOption();
CPDF_StartPDFToExcel(CPDF_TEXT("excel.pdf"), CPDF_TEXT("password"), CPDF_TEXT("path/output.xlsx"), option, NULL);

option.excel_all_content = true;
option.excel_worksheet_option = e_CForDocument;
CPDF_StartPDFToExcel(CPDF_TEXT("excel.pdf"), CPDF_TEXT("password"), CPDF_TEXT("path/output_all.xlsx"), option, NULL);