Add to PDF

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.


  • 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.
A bubbling flask with code brackets inside
Try Now with API Lab

Start right from your browser - upload files, choose parameters, generate code, and send API Calls directly from API Lab!  

to receive your free API Key.
Parameters
Required Parameters
POST
curl -X POST "https://api.pdfrest.com/pdf-with-added-image" \ 
  -H "Accept: application/json" \ 
  -H "Content-Type: multipart/form-data" \
  -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
  
Response
The response for your API Call will display here.
Once you've sent your POST request and received a valid response, you can download your output file using the output URL.

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 that relies on the PDF/A-3 format with attached XML files. Similarly, the Saudi Arabia FATOORAH standard also mandates 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.

Start from Code Examples
  1. First, you'll need an API Key - to:
    • Stay anonymous with a Guest API Key for 10 free API Calls
    • Sign up for an upgraded API Key with unlimited, continuous service
  2. Choose your programming language
  3. Copy and paste the code to your project
  4. Update Api-Key field with your unique API Key
  5. Update file with the local path to your input
  6. Run this code to send an API Call
See more code examples in our
GitHub repository
Try pdfRest with just a few clicks
Download our Postman Postman Collection
Customize Your Solution
Image File
Compatible with the /pdf-with-added-image endpoint.

The image_file parameter allows you to select a local image to be uploaded to pdfRest’s processing server.

The following file formats are accepted:
  • .gif
  • .jpg/.jpeg
  • .png
  • .tif/.tiff
Generate a self-service API Key now!

Create your FREE API Key to start processing PDFs in seconds, only possible with pdfRest.

Compare Plans
Contact Us