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, line 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
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
Add Generated Barcodes to PDF Forms
Add Generated Barcodes to PDF Forms
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. Optional tagging also helps newly inserted text and table content carry useful structure for downstream processing and accessibility-oriented workflows.

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

Text Objects

text_objects 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 here: pdfRest Documentation | Fonts
  • max_width: (string) the maximum width of the text column in PDF Units (72 PDF Units = 1 inch). The text will wrap to conform to this width.
  • opacity: (string) text opacity (0.0 - 1.0)
  • page: (string) page number on which to add text. You can provide a page number, or you can 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) the string of text to add
  • text_color_cmyk or text_color_rgb: (string) comma-delineated string of color values (RGB example: "53,5,102", CMYK example: "0,100,100,0"). Use one of these to set the text color.
  • text_size: (string) font size of the text (5 - 100)
  • x: (string) horizontal starting position of the text in PDF Units (72 PDF Units = 1 inch)
  • y: (string) vertical starting position of the text in PDF Units (72 PDF Units = 1 inch)
  • is_rtl: (string) set to "true" to insert right-to-left (RTL) 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.

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.

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. This is useful for invoices, reports, statements, schedules, comparison tables, and other data-driven documents.

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. 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, and /pdf-with-added-tables endpoints are ideal for variable data printing. You can use a single PDF template, or a blank PDF created with Create Blank PDF, and dynamically insert personalized text (like a name or address), images (like a customer's logo), and structured tables (like line items or account details) to create unique, customized documents for each recipient.

The /pdf-with-added-image endpoint supports common formats including JPEG, TIF, PNG, and GIF. You can achieve precise positioning by specifying the x and y coordinates for the image's lower-left corner, measured in PDF units (72 PDF units = 1 inch) from the lower-left corner of the page. You can also specify width and height to control the displayed image size.

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 content. This can help identify added text, images, shapes, and table content in the PDF structure for downstream processing and accessibility-oriented workflows. When used with a blank PDF generation workflow, inserted content can be tagged as the document is built. When used with an already tagged PDF, newly added content can be tagged while preserving the existing structure. Add to PDF does not automatically tag 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.