How to add text and images to PDF in cURL using PDF.co Web API

This code in cURL shows how to add text and images to PDF with this how to tutorial

The documentation is designed for a specific purpose to help you to apply the features on your side. PDF.co Web API is the flexible Web API that includes full set of functions from e-signature requests to data extraction, OCR, images recognition, pdf splitting and pdf splitting. Can also generate barcodes and read barcodes from images, scans and pdf and you can use it to add text and images to PDF with cURL.

The SDK samples given below describe how to quickly make your application do add text and images to PDF in cURL with the help of PDF.co Web API. This cURL sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Applying cURL application mostly includes various stages of the software development so even if the functionality works please test it with your data and the production environment.

All these programming tutorials along with source code samples and ByteScout free trial version are available for download from our website.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

AddImageToExistingPDF.cmd
      
@echo off :: Path of the cURL executable set CURL="curl.exe" :: The authentication key (API Key). :: Get your own by registering at https://app.pdf.co/documentation/api set API_KEY=*********************************** :: Direct URL of source PDF file. set SourceFileUrl=https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-edit/sample.pdf ::Comma-separated list of page indices (or ranges) to process. Leave empty for all pages. Example: '0,2-5,7-'. ::set Pages= :: PDF document password. Leave empty for unprotected documents. ::set Password= :: Destination PDF file name set DestinationFile=result.pdf :: Image params set Type=image set X=400 set Y=20 set Width=119 set Height=32 set ImageUrl=https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png :: * Add image * :: Prepare request to `PDF Edit` API endpoint set query="https://api.pdf.co/v1/pdf/edit/add?name=%DestinationFile%&password=&pages=&url=%SourceFileUrl%&type=%Type%&x=%X%&y=%Y%&width=%Width%&height=%Height%&urlimage=%ImageUrl%" :: Perform request and save response to a file %CURL% -# -X GET -H "x-api-key: %API_KEY%" %QUERY% >response.json :: Display the response type response.json :: Use any convenient way to parse JSON response and get URL of generated file(s) echo. pause

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit PDF.co Web API Home Page

Explore PDF.co Web API Documentation

Explore Samples

Sign Up for PDF.co Web API Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit PDF.co Web API Home Page

Explore PDF.co Web API Documentation

Explore Samples

Sign Up for PDF.co Web API Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Related Samples: