Stamp an image
Draws an uploaded PNG or JPEG image over pages: a logo, a signature, a seal.
POST/forms/pdf/stamp-image
Form data
Options
Place a stamp
A stamp's x and y count in points from the bottom-left corner of the page, 72 points to the inch. A Letter page measures 612 by 792 points, an A4 page 595 by 842. Without pages, a stamp goes on every page.
curl \
--request POST http://localhost:3000/forms/pdf/stamp-image \
--form files=@report.pdf \
--form files=@logo.png \
--form image=logo.png \
--form x=374 \
--form y=24 \
--form width=48 \
--form pages=1 \
-o report.pdf
Set width or height and Gotenberg keeps the image's proportions. The image is a PNG or a JPEG.
In a list of stages
The stage also runs in a list on /forms/pdf/pipe, and on the PDFs a Chromium or LibreOffice conversion makes, in its stages field:
curl \
--request POST http://localhost:3000/forms/pdf/pipe \
--form files=@report.pdf \
--form files=@logo.png \
--form 'stages=[
{ "op": "stamp-image", "image": "logo.png", "x": 36, "y": 36, "width": 64 }
]' \
-o report.pdf