Stamp a PDF page
Draws a page of another PDF over pages: a letterhead, a seal.
POST/forms/pdf/stamp-pdf
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.
Stamp a letterhead
curl \
--request POST http://localhost:3000/forms/pdf/stamp-pdf \
--form files=@report.pdf \
--form files=@letterhead.pdf \
--form source=letterhead.pdf \
-o report.pdf
Draw the letterhead on a transparent page, so the content under it shows: Chromium makes one from HTML with printBackground and omitBackground. scale resizes the page, and sourcePage picks another page of the source.
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=@annex.pdf \
--form 'stages=[
{ "op": "stamp-pdf", "source": "annex.pdf", "scale": 0.5, "opacity": 0.3 }
]' \
-o report.pdf