Add to PDF Logo

Add to PDF

Add to PDF is a REST API tool designed to add new content to PDF documents, including text, images, lines, rectangles, tables, and file attachments. Developers can use it to enhance existing PDFs without disrupting underlying content, or pair it with Create Blank PDF to generate new PDFs from scratch for invoices, reports, statements, forms, and other data-driven documents.

Key Benefits of Add to PDF API

  • Automate PDF content creation and enhancement workflows, eliminating the need for manual editing in Acrobat, Illustrator, or other software.
  • Pair with Create Blank PDF to generate new documents from application data, including invoices, reports, statements, forms, and other structured PDFs.
  • Place text, images, lines, rectangles, and tables with coordinate-level control, making it easier to align inserted content with exact page layouts.
  • Build structured PDF tables with headers, footers, merged cells, styling, image cells, and multi-page overflow support for data-driven documents.
  • Customize text insertion for both LTR and RTL languages with font, size, color, rotation, opacity, maximum width, wrapping, and placement controls.
  • Add optional structure tags for newly inserted text, images, shapes, and tables to support more structured generated or enhanced PDF output.
  • Attach source files, XML data, spreadsheets, or supporting documents directly within a PDF for e-invoicing, archival, and compliance workflows.
Build Your Solution

You have document processing problems, we have Solutions. Explore the many ways pdfRest can align your documents with your business objectives.

Browse all solutions
Generate Tagged PDFs from Scratch with Application Data
Create Tagged PDFs from Scratch with Application Data
Personalize PDF Templates with Dynamic Content
Personalize PDF Templates with Dynamic Content
Generate Dynamic PDF Reports with Structured Tables
Generate Dynamic PDF Reports with Structured Tables
The pdfRest logo is added to the Microsoft Power Automate logo with a representation of a PNG to PDF conversion workflow
Integrate pdfRest with Microsoft Power Automate
Achieve Custom PDF Generation Workflows via API
Achieve Custom PDF Generation Workflows via API
Ensure GDPR Compliance for PDF Processing with EU-Based Cloud API
Ensure GDPR Compliance for PDF Processing with EU-Based Cloud API
Why is pdfRest the best API to add content to PDF?
pdfRest offers a flexible API for adding text, images, shapes, tables, and attachments to PDF documents. It supports precise positioning, variable data workflows, structured table insertion, optional tags for newly added content, and PDF Generation workflows when paired with Create Blank PDF.

Add Images and Shapes to PDF with Precise Positioning

The Add to PDF API Tool supports precise visual placement through the /pdf-with-added-image and /pdf-with-added-shapes endpoints. Developers can use these endpoints to add visual elements to existing PDFs or to blank PDFs created with Create Blank PDF.

Common use cases include:

  • Placing logos, stamps, signatures, photos, diagrams, and product images.
  • Drawing divider lines, table rules, borders, panels, and callout boxes.
  • Building generated PDF layouts from reusable visual components.
  • Controlling image size, shape color, stroke width, fill color, and opacity.

These capabilities are useful when applications need repeatable layout control, such as adding branded elements to templates, highlighting content regions, or constructing generated PDFs from a blank canvas without manual editing.

Add Text and Tables to PDF for Variable Data Printing

The Add to PDF API Tool supports dynamic text and table insertion through the /pdf-with-added-text and /pdf-with-added-tables endpoints. Developers can use these endpoints to place structured application data into template PDFs or blank PDFs created with Create Blank PDF.

Common use cases include:

  • Adding names, addresses, account details, status fields, and custom messages.
  • Creating invoices, statements, schedules, reports, and order summaries.
  • Building tables with headers, footers, merged cells, styling, and image cells.
  • Supporting multi-page tables with overflow handling and repeated headers.

These capabilities make it possible to generate polished, data-driven PDFs without manually drawing each text field, table cell, line, and border. Tables can reserve space for surrounding content, continue across pages, repeat headers or footers when configured, and apply optional tags to newly inserted text and table content.

Attach File to PDF for e-Invoicing Compliance

With the Add to PDF API Tool, you can use the /pdf-with-added-attachment endpoint to add any file as an attachment to a PDF. This capability is useful for providing supplementary information, supporting collaboration, preserving source data, and creating complete document packages.

Common use cases include:

  • Attaching XML data for e-invoicing standards such as ZUGFeRD or FATOORAH.
  • Embedding spreadsheets, source files, receipts, or supporting records.
  • Creating audit-ready PDF packages with human-readable and machine-readable data.
  • Preserving related materials for archival, compliance, and exchange workflows.

Attaching files to PDFs is particularly important for e-invoicing standards that require machine-readable files to be embedded with a human-readable PDF. By using Add to PDF, developers can keep generated or enhanced PDFs connected to the structured data and supporting files required by downstream business systems.

Start from Code Examples
See more code examples in our GitHub repository
Customize Your Solution

Learn about the parameters for this tool to create your custom solution.

Text Objects

Compatible with the /pdf-with-added-text endpoint.

The text_objects parameter is a JSON-formatted string consisting of an array of one or more objects containing options to add and format text.

Text Object options:

  • font: (string) Specify the font of the given string. See available fonts in the pdfRest documentation.
  • max_width: (string) Maximum width of the text column in PDF units, where 72 PDF units equal 1 inch. The text wraps to conform to this width.
  • opacity: (string) Text opacity from 0.0 to 1.0.
  • page: (string) Page number on which to add text. You can provide a page number or use all to add the text to every page at the same X/Y position.
  • rotation: (string) Rotation in degrees of the text block.
  • text: (string) Text to add.
  • text_color_cmyk or text_color_rgb: (string) Comma-delimited color values. An RGB example is "53,5,102". A CMYK example is "0,100,100,0". Use one of these options to set the text color.
  • text_size: (string) Font size of the text. Supported values range from 5 to 100.
  • x: (string) Horizontal starting position of the text in PDF units.
  • y: (string) Vertical starting position of the text in PDF units.
  • is_rtl: (string) Set to true to insert right-to-left language text.
  • tag_actual_text: (string) Optional replacement text for tagged content. Requires tag_enabled=true.
  • tag_is_artifact: (boolean) Set to true to mark the inserted text as an artifact instead of regular structure content. Requires tag_enabled=true.
  • tag_structure_type: (string) Optional PDF structure type for the inserted text. Requires tag_enabled=true.

Set the request-level tag_enabled parameter to true for tag metadata to be applied. Tagging applies to newly inserted text and does not remediate existing untagged content.

Example:

[
  {
    "font": "Arial",
    "max_width": "240",
    "opacity": "1",
    "page": "1",
    "rotation": "0",
    "text": "Invoice #INV-1042",
    "text_color_rgb": "26,72,112",
    "text_size": "18",
    "x": "72",
    "y": "720",
    "tag_structure_type": "H1",
    "tag_actual_text": "Invoice number INV-1042"
  },
  {
    "font": "Arial",
    "max_width": "360",
    "opacity": "1",
    "page": "1",
    "rotation": "0",
    "text": "Payment due within 30 days.",
    "text_color_rgb": "55,65,81",
    "text_size": "11",
    "x": "72",
    "y": "690",
    "tag_structure_type": "P"
  }
]

Safe & Secure

Confidently process your sensitive data with pdfRest. Our platform is built for robust, Enterprise-grade security and compliance. We meet rigorous standards for GDPR and HIPAA, and our controls are independently audited to ensure strict SOC 2 Type 2 compliance. Your data's protection is our commitment.

Frequently Asked Questions
Need more help? Contact Us or visit our documentation.

The Add to PDF API Tool adds text, images, shapes, tables, and file attachments to PDF documents. It supports precise placement, structured table insertion, optional tagging, and PDF Generation workflows when paired with Create Blank PDF.

The API provides five primary functions:

  • Add Text: Inserts text blocks with full control over font, size, color, wrapping, language direction, and position.
  • Add Images: Places images (JPEG, PNG, TIF, GIF) with precise positioning and optional width and height controls.
  • Add Shapes: Draws lines and rectangles with configurable stroke, fill, color, and opacity.
  • Add Tables: Inserts structured tables with rows, columns, headers, footers, merged cells, styling, image cells, and overflow handling.
  • Add Attachments: Attaches any file format to the PDF, such as a spreadsheet, XML file, or another PDF.

Yes. Start with Create Blank PDF, then use Add to PDF endpoints to place text, images, shapes, and tables onto the blank document. This supports PDF Generation workflows such as invoices, reports, statements, forms, certificates, labels, and other documents built from application data.

Yes. The /pdf-with-added-tables endpoint supports structured table insertion with rows, columns, headers, footers, merged cells, styling, image cells, and multi-page overflow handling. Tables can also reserve space for surrounding page content, repeat headers or footers when configured, split or move rows according to overflow settings, and apply optional tags to newly inserted table content.

This is useful for invoices, reports, statements, schedules, comparison tables, and other data-driven documents.

Using the /pdf-with-added-text endpoint, you can insert text blocks with extensive customization. The text_objects parameter allows you to specify the font, size, color, rotation, opacity, and position of the text. You can also define a max_width to automatically wrap text to a new line, and configure right-to-left text for supported language workflows.

The /pdf-with-added-text, /pdf-with-added-image, /pdf-with-added-shapes, and /pdf-with-added-tables endpoints are ideal for variable data printing and PDF Generation workflows.

You can use a single PDF template, or a blank PDF created with Create Blank PDF, and dynamically insert personalized text such as a name or address, images such as a customer's logo, shapes such as visual panels or dividers, and structured tables such as line items or account details.

This makes it possible to create unique invoices, reports, statements, forms, certificates, labels, and other documents from application data.

The /pdf-with-added-image endpoint supports common formats including JPEG, TIF, PNG, and GIF.

For single image insertion, specify the image's x and y coordinates, page, and optional width and height. For multiple image insertion, use image_objects to place one or more images in a single request. Each image object can specify its image source, page or page range, position, displayed dimensions, and optional tagging metadata.

The same uploaded or previously stored image can be reused in multiple placements without uploading it again. Coordinates use PDF units, where 72 PDF units equal 1 inch, and the origin is normally at the lower-left corner of the page.

Attaching a file to a PDF is a crucial feature for adding supplementary information, preserving source data, or complying with specific document standards. For example, many e-invoicing standards like ZUGFeRD and FATOORAH require an XML file to be embedded as an attachment within a PDF document.

Add to PDF supports optional tags for newly inserted text, images, shapes, and table content. This can help identify added content in the PDF structure for downstream processing and accessibility-oriented workflows.

When used with Create Blank PDF, inserted content can be tagged as the document is built. When used with an already tagged PDF, newly added tagged content can be appended while preserving the existing structure.

For tables, optional tags can include table, row, header-cell, data-cell, merged-cell span, and image-cell structure information. Add to PDF does not automatically tag or remediate pre-existing untagged content already present in the input PDF.

pdfRest offers a best-in-class solution because it provides precise positioning for adding content exactly where you need it, supports robust variable data printing for personalized content at scale, adds structured tables without low-level drawing logic, and enables flexible file attachments to meet modern document packaging needs. When paired with Create Blank PDF, Add to PDF also supports PDF Generation workflows for building new documents from application data.

Ensuring the security and privacy of your data is a top priority at pdfRest. Our platform is built for robust, enterprise-grade security and compliance, including GDPR and HIPAA. All your files are secured with encryption during both transit and at-rest, and they are permanently deleted after the stated file retention period (30 minutes for most plans). For complete details, please refer to our Data Processing Agreement (DPA).

To facilitate GDPR compliance for your content addition workflows, pdfRest processes your data within the European Union and adheres to other strict data protection requirements. You can ensure all processing occurs within the EU by sending your API calls to the dedicated EU endpoints for each tool. Please note that a GDPR usage fee may apply for some plans. For more information, please review our Data Processing Agreement.

Integrating the Add to PDF API is straightforward. We offer comprehensive API documentation and code samples in many programming languages. The API Lab also allows you to test and generate code snippets directly from your browser, simplifying the setup and ensuring a smooth integration experience.

You can easily add content to PDFs without writing any code. For a more conversational workflow, you can add text to a PDF, add images to a PDF, or add attachments to a PDF with a simple chat-based interface.

Yes, pdfRest offers two self-hosted options. The pdfRest API Toolkit on AWS allows you to deploy and manage your own backend processing infrastructure within your AWS environment with pay-as-you-go pricing through the AWS Marketplace. The pdfRest API Toolkit Container provides ultimate environmental control as a Docker Container, giving you the flexibility to run the API in on-premises data centers or public/private cloud environments with a flexible, custom licensing model.

Generate a self-service API Key now!
Create your FREE API Key to start processing PDFs in seconds, only possible with pdfRest.