Guide

Add watermark

Overlay a graphic on PDF pages, or an image/logo onto video.

api2convert can add a watermark to PDF documents and videos. To watermark a PDF, overlay an image or another PDF onto every page: provide two inputs — the base document first and the overlay (the watermark/stamp graphic) second — then enable either stamp or watermark on a document / pdf conversion and choose where the overlay is placed with alignment. To watermark a video, overlay an image (a logo or watermark) or another video with the overlays option — see Watermark a video at the end of this guide.

How it works

The overlay is applied to every page of the base PDF. The order of inputs matters: the first input is the PDF to stamp, the second is the image (PNG, JPG) or PDF used as the overlay. Common overlay formats are PNG (for transparency), JPG, and single-page PDF.

A transparent PNG overlay gives the cleanest result, since the surrounding area stays see-through regardless of stamp or watermark mode.

Stamp vs. watermark

Both place the overlay on each page — the difference is opacity.

Option Effect Typical use
stamp Opaque overlay drawn on top of the page content. Logos, seals, "APPROVED" / "PAID" marks.
watermark Semi-transparent overlay that lets the page show through. "DRAFT" / "CONFIDENTIAL" background marks.

Set exactly one of them to true.

Alignment

Use alignment to position the overlay on the page.

Value Placement
center Overlay centered on the page (default-style placement).
top Overlay aligned to the top of the page.
bottom Overlay aligned to the bottom of the page.
stretch Overlay scaled to fill the whole page.

Full example

Two remote inputs — the document first, the overlay image second — producing a PDF with an opaque, centered stamp:

{
  "input": [
    {
      "type": "remote",
      "source": "https://example-files.online-convert.com/document/pdf/example.pdf"
    },
    {
      "type": "remote",
      "source": "https://example-files.online-convert.com/raster%20image/png/example.png"
    }
  ],
  "conversion": [
    {
      "category": "document",
      "target": "pdf",
      "options": {
        "stamp": true,
        "alignment": "center"
      }
    }
  ]
}

To make the overlay a semi-transparent watermark instead, swap the options:

{
  "options": {
    "watermark": true,
    "alignment": "stretch"
  }
}

Submit the job with your API key in the x-oc-api-key header:

curl -X POST "https://api.api2convert.com/v2/jobs" \
  -H "x-oc-api-key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "input": [
        {
            "type": "remote",
            "source": "https://example-files.online-convert.com/document/pdf/example.pdf"
        },
        {
            "type": "remote",
            "source": "https://example-files.online-convert.com/raster%20image/png/example.png"
        }
    ],
    "conversion": [
        {
            "category": "document",
            "target": "pdf",
            "options": {
                "stamp": true,
                "alignment": "center"
            }
        }
    ]
}'
For the exact options supported by the pdf target, see the format explorer. For the end-to-end job lifecycle, see the getting started guide.

Live options

Pick stamp or watermark to see its options (and a copyable request). Remember to add the overlay as the second input:

Loading options…

Watermark a video

To watermark a video, add the overlays option to a video conversion (for example mp4). Each overlay draws an image — a logo or watermark — or another video on top of the output. Unlike the PDF watermark, a video overlay references its graphic by input_id, so it takes two requests: create the job with both files, read the overlay input's id, then add the conversion.

Overlays work on every video target. Adding an overlay re-encodes the video, so it can't be combined with stream copy (codec: "copy").

Overlay options

Option Description
input_id The id of the input to use as the overlay — an image or a video. Required.
origin Corner the position is measured from: top-left (default), top-right, bottom-left, bottom-right or center.
position_x / position_y Offset in pixels from the origin.
width / height Scale the overlay to this size in pixels (optional).
opacity Overlay opacity from 0 (invisible) to 1 (fully opaque), e.g. "0.5".

Step 1 — create the job with both inputs

Add the base video first and the overlay image second. The response returns each input with an id — note the overlay's id for the next step.

curl -X POST "https://api.api2convert.com/v2/jobs" \
  -H "x-oc-api-key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "input": [
        {
            "type": "remote",
            "source": "https://example-files.online-convert.com/video/mp4/example.mp4"
        },
        {
            "type": "remote",
            "source": "https://example-files.online-convert.com/raster%20image/png/example.png"
        }
    ]
}'

Step 2 — add the conversion with the overlay

Reference the overlay input by its id and place it with origin, position_x / position_y and opacity:

curl -X POST "https://api.api2convert.com/v2/jobs/<job-id>/conversions" \
  -H "x-oc-api-key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "target": "mp4",
    "options": {
        "overlays": [
            {
                "input_id": "<overlay-input-id>",
                "origin": "bottom-right",
                "position_x": 20,
                "position_y": 20,
                "opacity": "0.5"
            }
        ]
    }
}'
Pass multiple entries in overlays to stack several logos or watermarks. For the exact, current options see the format explorer.