
Generate Tagged PDFs from Scratch with Application Data
The Challenge of Generating Structured PDF Documents
Many applications need to generate professional PDF documents from changing business data. Invoices, reports, statements, certificates, compliance forms, and other documents often require precise layouts, consistent branding, tables, images, and structured content.
Static templates can become difficult to maintain when page layouts change, content varies by request, or new document types must be introduced. Developers need a way to generate the document canvas and place content directly from application data while maintaining control over the final PDF structure.
For workflows that support accessibility-oriented processing or downstream document analysis, it can also be important to identify the content being added to the PDF.
The Solution: Generate Tagged PDFs from a Blank Canvas
pdfRest provides a flexible workflow for generating custom PDF documents from scratch. Use the Create Blank PDF API Tool to establish the document canvas, then use the Add to PDF API Tool to place content onto that canvas.
The Add to PDF API Tool supports optional structure tags for newly inserted text, images, shapes, and table content. This allows applications to identify generated content in the PDF structure for downstream processing and accessibility-oriented workflows.
Tagging applies to content added by the current request. It does not automatically create tags for pre-existing untagged content in the input PDF. When content is added to an already tagged PDF, newly inserted tagged content can be appended while preserving the existing structure.
Step-by-Step PDF Generation Workflow
- Define the document canvas: Use Create Blank PDF to specify the page size, orientation, and number of pages required for the document.
- Add document content: Pass the resulting file identifier to Add to PDF and insert text, images, lines, rectangles, and tables at precise positions.
- Apply optional structure tags: Enable tagging for newly inserted content and provide the appropriate structure metadata for text, images, shapes, and table cells.
- Assemble and finalize the document: Use the Merge PDFs API Tool to combine generated pages or supporting documents, and use the Convert to PDF/A API Tool when archival output is required.
To explore the workflow interactively, try Create Blank PDF in API Lab and Add to PDF in API Lab. These API Tool pages provide the interactive API Lab experience with the corresponding request configuration.
Generate Documents from Real-World Application Data
Once the document canvas is defined, your application can supply the data needed to produce each individualized PDF. The same workflow can support many document types and industries:
- Invoices: Generate customer details, payment terms, line items, taxes, totals, logos, and supporting attachments.
- Financial statements: Present account information, transaction tables, balances, and reporting periods in a consistent layout.
- Compliance forms: Create documents with required fields, structured content, identifiers, and organization information.
- Operational reports: Combine headings, summaries, tables, status indicators, images, and page footers.
- Certificates: Produce personalized documents containing names, dates, credentials, signatures, and branding.
- Shipping and logistics documents: Generate labels, manifests, package details, addresses, and tracking information at runtime.
Build Structured Tables and Layouts
Generated documents often depend on more than individually positioned text. Add to PDF supports table-oriented layouts for data-driven documents, including:
- Fixed and proportional column widths
- Header and footer rows
- Repeated headers when tables continue onto additional pages
- Merged cells spanning rows or columns
- Text and image cells
- Table, row, column, and cell styling
- Cell padding, borders, fills, opacity, and text formatting
- Optional structure tags for tables, headers, cells, and cell content
This makes it possible to generate structured invoices, reports, schedules, statements, and other business documents directly from records or transactions.
Why Generate Tagged PDF Content?
Structure tags provide information about the role of newly inserted content within the PDF. Depending on the content, tags can identify items such as headings, paragraphs, figures, tables, table headers, and table cells.
This information can help support:
- Accessibility-oriented document workflows
- Downstream content processing and extraction
- Document analysis and classification
- Clearer identification of generated table structure
- Workflows that add new content to an already tagged PDF
Tagging is optional, allowing applications to choose the level of structure needed for each document-generation workflow.
Finalize and Deliver Generated PDFs
After content has been generated, the resulting PDF can be passed through additional pdfRest workflows to prepare it for delivery, storage, or archival:
- Combine generated pages or related documents with Merge PDFs.
- Prepare the document for long-term preservation with Convert to PDF/A.
- Compress the output for more efficient storage or transmission.
- Attach XML, spreadsheets, or supporting files to the PDF.
- Encrypt or restrict the document when access controls are required.
- Integrate the result with storage, delivery, or archival systems.
Start Generating Tagged PDFs
Use Create Blank PDF to define the document canvas, then use Add to PDF to populate it with application data and optional structure tags.
This workflow gives developers a practical foundation for generating custom PDFs from scratch, producing consistent business documents, and identifying newly inserted content for downstream processing.
Try the workflow in API Lab or explore the pdfRest API documentation to begin building your own PDF generation solution.