Skip to content
ComPDF

Overview

When you need to extract text content from a PDF file for data analysis, text mining, or information retrieval, ComPDF Conversion SDK can extract the text into a TXT file.

Preserving Table Format

The SDK supports txt_table_format to preserve the table format when writing the TXT file. It is generally recommended to enable this option, especially for data extraction scenarios.

Sample

c
CConvertOption option = CPDF_DefaultConvertOption();
option.txt_table_format = true;

CPDF_StartPDFToTxt(CPDF_TEXT("txt.pdf"), CPDF_TEXT("password"), CPDF_TEXT("path/output.txt"), option, NULL);