Add to PDF Logo

Add to PDF

Add to PDF is a REST API tool designed to enhance your PDFs by inserting new content, including text, images, and file attachments. By using Add to PDF, developers can seamlessly integrate additional elements into PDFs, ensuring precision and flexibility without altering the existing content.

Key Benefits of Add to PDF API

  • Automate content enhancement workflows, eliminating the need for manual editing in Acrobat, Illustrator, or other software.
  • Place images with precision, ensuring they complement the existing PDF layout without disrupting underlying content.
  • Attach any file format to a PDF, providing additional context or resources directly within the document.
  • Leverage advanced positioning features to tailor content placement to specific requirements.
  • Customize text insertion for both LTR and RTL languages with font, size, color, rotation, line width, and more.
  • Support variable data printing by dynamically inserting personalized text, such as customer names and addresses.
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
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
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
Add Page Numbers to PDF Files
Add Page Numbers to PDF Files
Automate PDF Text Insertion for Variable Data Printing
Automate PDF Text Insertion for Variable Data Printing
Create an e-Invoicing PDF Workflow for Regulatory Compliance
Create an e-Invoicing PDF Workflow for Regulatory Compliance
Why is pdfRest the best API to add text, images, or attachments to PDF?
pdfRest offers the best solution for adding text, images, or attachments to PDF documents, because it supports precise image positioning, robust variable data printing, and flexible file attachments.

Add Image to PDF with Precise Positioning

The Add to PDF API Tool, accessible via the /pdf-with-added-image endpoint, simplifies the process of adding images to a PDF, allowing you to place them exactly where you need them.

Whether you're adding logos, diagrams, or photographs, the Add to PDF API Tool supports a wide range of the most common graphic image formats, ensuring high-quality preservation of color accuracy and resolution. This versatility allows you to maintain the visual integrity of your images, regardless of the format:

  • JPEG (.jpg, .jpeg): Ideal for photographs and images with complex color gradients.
  • TIF (.tif, .tiff): Perfect for high-resolution images that require lossless compression.
  • PNG (.png): Suitable for images with transparency and sharp edges, such as logos and icons.
  • GIF (.gif): Best for simple graphics and images with limited color palettes.

By leveraging the Add to PDF API Tool, you can seamlessly integrate images into your PDFs, enhancing the document's visual appeal and functionality. Whether you're preparing marketing materials, technical documents, or personalized content, this tool provides the flexibility and precision needed to achieve professional results.

Add Text to PDF for Variable Data Printing

Effortlessly create custom PDFs tailored for each customer, user, or recipient with precision and ease. Automate and streamline your workflow by adding variable data to template PDFs with the /pdf-with-added-text and /pdf-with-added-image endpoints, including personalized logos, photos, and user information. The Add to PDF tool allows you to "stamp" content exactly where you need it, without altering the underlying content of the PDF.

With the ability to customize text insertion—choosing font, size, color, rotation, opacity, position, page, and line width—you can ensure that every document meets your specific requirements. This flexibility supports both LTR and RTL languages, making it ideal for multilingual applications.

Whether you need to add your customers' business logos to their invoices, addresses onto envelopes, or personalized messages and branding elements to marketing materials, the Add to PDF API Tool simplifies the process. It supports variable data printing, allowing you to dynamically insert personalized text, such as customer names or addresses, ensuring each document is uniquely tailored to its recipient.

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 effortlessly add any file as an attachment to a PDF. This capability is invaluable for a variety of reasons, such as providing supplementary information, facilitating collaboration, and preserving backups.

Attaching files to PDFs is particularly crucial in meeting the requirements of various e-invoicing standards worldwide. For instance, ZUGFeRD is a German standard for e-invoicing based on the PDF/A-3 format with attached XML files. Similarly, the Saudi Arabia FATOORAH standard also requires XML files to be attached to PDF/A-3 documents.

By using the Add to PDF API Tool, you can ensure compliance with these standards and streamline your document workflows. Whether you're attaching XML files for e-invoicing or adding supplementary documents for enhanced collaboration, this tool provides a seamless solution for integrating additional content into your PDFs.

Customize Your Solution

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

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

Example:

[
   {
      "font":"Arial",
      "max_width":"100",
      "opacity":"1",
      "page":"all",
      "rotation":"80",
      "text":"Hello, PDF world!",
      "text_color_rgb":"0,0,0",
      "text_size":"12",
      "x":"144",
      "y":"144"
   },
   {
      "font":"Times New Roman",
      "max_width":"100",
      "opacity":"1",
      "page":"all",
      "rotation":"0",
      "text":"More text to add!",
      "text_color_rgb":"128,0,2",
      "text_size":"72",
      "x":"144",
      "y":"720"
   }
]

Safe & Secure

Confidently process your sensitive data with pdfRest. Our platform is fortified for robust, Enterprise-grade security and compliance, including GDPR, HIPAA, and SOC 2 Type 2 certification in progress. Your data's protection is our priority.

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

The Add to PDF API is a collection of REST API tools that allow you to programmatically add new content to a PDF document without altering its existing structure. It includes three distinct endpoints for adding text, images, and file attachments.

The API provides three primary functions:

  • Add Text: Inserts text blocks with full control over font, size, color, and position.
  • Add Images: Places images (JPEG, PNG, TIF, GIF) with precise positioning.
  • Add Attachments: Attaches any file format to the PDF, such as a spreadsheet, XML file, or another PDF.

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.

The /pdf-with-added-text and /pdf-with-added-image endpoints are ideal for variable data printing. You can use a single PDF template and dynamically insert personalized text (like a name or address) and images (like a customer's logo) 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.

Attaching a file to a PDF is a crucial feature for adding supplementary information 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 for regulatory compliance.

pdfRest offers a best-in-class solution because it provides precise positioning for adding images exactly where you need them, supports robust variable data printing for personalized content at scale, and enables flexible file attachments to meet modern document standards like e-invoicing compliance.

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.