overlay

fun overlay(pdf: ByteArray, overlayPdf: ByteArray): ByteArray

Overlays overlayPdf onto pdf (the overlay drawn in front of each page's existing content) via PdfBox's Overlay.

The overlay's first page is reused for every input page (the common "stamp a letterhead / background frame onto each page" case), so a single-page overlay applies uniformly to a multi-page base document.

Return

the overlaid PDF bytes.

Parameters

pdf

the base PDF bytes.

overlayPdf

the PDF whose first page is stamped over each base page.