PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Extract text, tables, and images from PDF documents to a JSON file.
Commonly, tables can be divided into two categories:
ComPDF Conversion SDK supports the option json_contain_table. When enabled, table content is extracted from PDFs together with table structure; otherwise, table content is treated as regular text.
Without enabling AI layout analysis or OCR options, tables in the original PDF may not be extracted with high precision. It is recommended to enable AI layout analysis, OCR, or table recognition when extracting complex tables.
options = ComPDFKitConversion::ConvertOptions.new
options.json_contain_table = true
options.enable_ai_layout = true
options.enable_ai_table_recognition = true
result = ComPDFKitConversion::Conversion.start_pdf_to_json(
input_file_path,
"",
output_file_path,
options
)