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.
Table Recognition reconstructs the internal structure of tables detected during layout analysis, including rows, columns, merged cells, and cell boundaries, so that the converted document preserves the original tabular semantics instead of producing a flat grid of text fragments.
It is controlled by the independent option enableAiTableRecognition, which is exposed on ConvertOption. The table model is only invoked for table regions reported by layout analysis whose detection confidence is below the trusted threshold; high-confidence native PDF tables bypass the model to save inference time.
Typical scenarios that benefit from Table Recognition:
Features that support Table Recognition:
enableAiLayout = true, or implicitly when enableOcr = true).LibraryManager::initialize from resource/models/documentai.model.enableAiTableRecognition = false disables the table model entirely; detected table regions will then fall back to geometric reconstruction from the underlying page objects.This sample demonstrates how to convert a PDF to a DOCX file with Table Recognition enabled.
$option = new ConvertOption();
// Layout analysis must be enabled for Table Recognition to take effect.
$option->enableAiLayout = true;
// Enable AI table recognition (set to false to disable).
$option->enableAiTableRecognition = true;
Conversion::convert('Word', 'word.pdf', 'password', 'output.docx', $option);