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.
Start right from your browser - upload files, choose parameters, generate code, and send API Calls directly from API Lab!
You have document processing problems, we have Solutions. Explore the many ways pdfRest can align your documents with your business objectives.
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.
Need more help?
Start with a Tutorial for step-by-step guidance
Learn about the parameters for this tool to create your custom solution.
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 | Fontsmax_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 blocktext
: (string) the string of text to addtext_color_cmyk
ortext_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"
}
]