Add table / report
add_tableGenerate a tabular PDF report from column headers and data rows. Supports wrapping, repeat header, zebra striping, and PDF/A conformance for professional data exports and summaries.
Instructions
Generate a tabular PDF report from column headers and data rows. Ideal for data exports, financial summaries, schedules. Smart-table fields (pdfnative v1.2) automatically engage the document backend: wrap (auto/always/never), repeatHeader (header row on every page), zebra (alternate-row tint), caption (above the table, tagged for PDF/A), minRowHeight (points), cellPadding (points). Every row must have the same length as headers. For PDF/A output, set pdfA="pdfa2b" (most compatible).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Report title rendered at the top of the document and used as PDF metadata title. | |
| headers | Yes | Column header labels. Must have the same length as each row in `rows`. | |
| rows | Yes | Data rows. Each row is an array of cell strings with the same length as `headers`. | |
| infoItems | No | Optional key-value metadata rows rendered below the title (e.g. date, author). | |
| footerText | No | Optional text rendered at the bottom of every page. | |
| autoFitColumns | No | When true, column widths auto-fit content (pdfnative v1.1). Switches the backend to buildDocumentPDFBytes; byte output differs from the default path. | |
| clipCells | No | When true, cell contents are clipped to column bounds via PDF clip-path operators (pdfnative v1.1). Recommended for PDF/A and visual safety. Switches the backend to buildDocumentPDFBytes. | |
| wrap | No | Cell wrap policy (pdfnative v1.2). 'auto' (default) wraps only when a cell overflows; 'always' wraps every cell; 'never' uses v1.1 character truncation. | |
| repeatHeader | No | Repeat the header row on every continuation page (pdfnative v1.2). Default true. | |
| zebra | No | Enable zebra striping (alternate-row light tint, PDF/A-1b safe). pdfnative v1.2. | |
| caption | No | Caption rendered above the table (and emitted as /Caption structure element in tagged/PDF/A mode). pdfnative v1.2. | |
| minRowHeight | No | Minimum row height in points (default 12). pdfnative v1.2. | |
| cellPadding | No | Horizontal cell padding in points applied to both insets (default 3). pdfnative v1.2. | |
| pdfA | No | Optional PDF/A conformance level (powered by pdfnative v1.2). Use 'pdfa1b' for archival of simple text+images, 'pdfa2b'/'pdfa2u' for richer content (2u guarantees Unicode mapping), 'pdfa3b' when embedding source attachments (Factur-X / ZUGFeRD). Mutually exclusive with PDF encryption. See docs/guides/PDFA.md. | |
| outputMode | No | Either 'base64' (returns the PDF inline) or 'file' (writes to a sandboxed path inside PDFNATIVE_MCP_OUTPUT_DIR). | base64 |
| outputPath | No | Required when outputMode='file'. Relative path inside the sandbox; must end with .pdf. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| sizeBytes | Yes | ||
| filePath | No | Absolute sandboxed file path (when mode='file'). | |
| base64 | No | Base64-encoded PDF bytes (when mode='base64'). |