Skip to content
ComPDF
DemoFAQ
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

Convert PDF to TXT

Overview

When you need to extract text content from a PDF file for data analysis, text mining, or information retrieval, use PDF to TXT conversion.

Preserving Table Format

Use txt_table_format to preserve table format when writing the TXT file.

Sample

ruby
options = ComPDFKitConversion::ConvertOptions.new
options.txt_table_format = true

result = ComPDFKitConversion::Conversion.start_pdf_to_txt(
  input_file_path,
  "",
  output_file_path,
  options
)