Stirling PDF icon

Stirling PDF

Merged API: Stirling PDF - Processing API + Stirling PDF - Management API + Stirling PDF - System API

Actions260

Misc → Add Stamp

AI-generated

Summary

Add a customizable text or image stamp to specified pages of a PDF file provided either via binary input or server-side file ID.

Inputs

  • fileInputBinaryProperty — Name of the binary property containing the input PDF file data; optional if using a server-side file ID instead.
  • fileId — File ID referring to a PDF stored server-side, used alternatively to binary input.
  • pageNumbers (required) — Pages to stamp, supporting 'all', specific pages, ranges like '1,3,5-9', or formulas like '2n+1'.
  • stampType (required) — Type of stamp to add, either 'text' or 'image'.
  • stampText — Text content of the stamp if 'text' type is selected.
  • stampImageBinaryProperty — Name of the binary property containing the stamp image data if 'image' type is selected.
  • alphabet — Alphabet style for the stamp text, e.g., roman, arabic, japanese, korean, chinese, or thai.
  • fontSize (required) — Font size in points for the stamp text or sizing for the stamp image.
  • rotation (required) — Rotation angle in degrees for the stamp.
  • opacity (required) — Opacity level of the stamp, from 0.0 (transparent) to 1.0 (opaque).
  • position (required) — Grid position (1-9) for stamp placement on the page, e.g., 1 for bottom-left, 5 for middle-center.
  • overrideX (required) — Optional override of the X coordinate for stamp placement; negative disables override.
  • overrideY (required) — Optional override of the Y coordinate for stamp placement; negative disables override.
  • customMargin (required) — Margin size around the stamp ('small', 'medium', 'large', 'x-large').
  • customColor — Color of the stamp text, applicable if stamp type is 'text'.

Output shape

a single record containing the stamped PDF binary data

The output includes the modified PDF file as binary data. Either the original PDF binary or a server-side file ID must be provided. Stamp parameters control appearance and placement. Errors occur on invalid inputs.

Examples

Example 1: Add a text stamp 'Confidential' in top-center on all pages of an input PDF binary

Set fileInputBinaryProperty to input binary field name, stampType to 'text', stampText to 'Confidential', pageNumbers to 'all', position to 8, opacity 0.5, fontSize 40, and desired rotation and color.

Example 2: Add an image stamp from binary to pages 1 and 3-5 of a server-side PDF file

Set fileId to server file ID, stampType to 'image', stampImageBinaryProperty to the image binary field, pageNumbers to '1,3-5', position and overrides as needed, with opacity and fontSize to control appearance.

Links

Discussion