
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.
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 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.
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
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_cmykortext_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 texttag_actual_text: (string) optional replacement text for tagged content. Requirestag_enabled=true.tag_is_artifact: (boolean) set totrueto mark the inserted text as an artifact instead of regular structure content. Requirestag_enabled=true.tag_structure_type: (string) optional PDF structure type for the inserted text. Requirestag_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.




