v2

latestOpenAPI 3.0.12026-07-266846393.5 KB
Editing

PDF Add

Add text, images, forms, other PDFs, fill forms, links to external sites and external PDF files. You can update or modify PDF and scanned PDF files.

post/v1/pdf/edit/add

Request body

filestring path to a local file

The path to the local file to be uploaded.

urlstring uri required

URL to the source file url attribute.

namestring

File name for generated output.

asyncboolean

Set async to true for long processes to run in the background, API will then return a jobId which you can use with the Background Job Check endpoint. Also see Webhooks & Callbacks

inlineboolean

Set to true to return results inside the response. Otherwise, the endpoint will return a URL to the output file generated.

templatedatastring

please set to string converted from JSON with data for Mustache template or leave empty if no template is used

expirationnumber

Sets the expiration time for the output link, in minutes. After this period, generated output file(s) are automatically deleted from PDF.co Temporary Files Storage. The maximum allowed duration depends on your subscription plan. For permanent storage of input files (e.g., reusable images, PDF templates, documents), use PDF.co Built‑In Files Storage.

xnumber
ynumber
widthnumber
heightnumber
pagesstring
passwordstring
typestring
urlimagestring

URL of the signature image file.

textstring
sizestring

Font size.

colorstring
transparentboolean
fontnamestring
timeoutnumber

Timeout for output links in seconds

annotationsStringstring {x};{y};{pages};{text};{fontsize};{fontname};{fontcolor};{link};{transparent};{width};{height};{alignment} required

This parameter represents one or more text objects to add to a PDF. Each object is made of parameter separated by the ; symbol.

imagesStringstring {x};{y};{pages};{urltoimageOrPdf};{linkToOpen};{width};{height}

Adds one or more images or other PDF objects on top of the source PDF. Each object is made of parameter separated by the ; symbol.

fieldsStringstring {page};{fieldName};{value}

Set values for fillable PDF field objects. Each object is made of parameter separated by the ; symbol.

profilesstring

Profiles are used configure extra options for specific API endpoints and may be unique to an API. For more information, see Profiles and the documentation of each endpoint for profiles specific to it.

httpusernamestring

HTTP auth user name if required to access source URL.

httppasswordstring

HTTP auth password if required to access source URL.

Example request

{
  "annotations": [
    {
      "pages": "0,2,5-10, !0, !5-!2"
    }
  ],
  "images": [
    {
      "pages": "0,2,5-10, !0, !5-!2"
    }
  ],
  "fields": [
    {
      "pages": "0,2,5-10, !0, !5-!2"
    }
  ]
}

Response

Success.

statusstring

Status of the API response.

messagestring

Descriptive message for the response status.

urlstring uri

URL to the output file.

jobIdstring

Unique identifier for the job.

creditsinteger

Credits used for this operation.

remainingCreditsinteger

Credits remaining after this operation.

durationinteger

Time taken to complete the request, in milliseconds.

Example response

{
  "status": "success",
  "message": "Success",
  "url": "https://pdf-temp-files.s3.us-west-2.amazonaws.com/output.pdf",
  "jobId": "6YSZD3U872ZYYFEDMQCQSGEEO8YSF5WA",
  "credits": 2,
  "remainingCredits": 1480582,
  "duration": 33
}