Skip to content
ComPDF

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
)