Add Image Stamp to PDF
Connector ID: ImageStamp
Watermarks with images are possible these days to warn the users from using the document content without permission. Like text stamps used in PDF4me, this type of watermarks also can be aligned vertically or horizontally.
- Method: POST
- Endpoint: /api/v2/ImageStamp
Parameters
- docNameString, Required
Source PDF file name with .pdf extension.
- docContentbase64, Required
The content of the input file.
- Align HorizontalString, Required
Horizontal alignment of image. The allowed values are
- Left - left edge of the page
- Center - equal distance from left and right edge of the page
- Right - right edge of the page
- Align VerticalString, Required
Vertical alignment of image. The allowed values are
- Top - top edge of the page
- Middle - equal distance from top and bottom edge of the page
- Bottom - bottom edge of the page
- Image File ContentBase64, Required
Map stamp image content from source action
- Image File NameString, Required
The image file name with proper extension - .png or .jpeg
- Margin Horizontal In mmString, Required
Set the horizontal margin (in millimeters) — the amount of space to be applied on both the left and right sides of the element or page.
Example: 20
- Margin Vertical In mmString, Required
Set the vertical margin (in millimeters) — the amount of space to be applied above and below the element or page.
Example: 20
- Margin Horizontal In pxString, Required
Set the horizontal margin (in pixels) to define the space on the left and right sides of the element or content.
Example: 10
- Margin Vertical In pxstring, Required
Set the vertical margin (in pixels) to define the space on the top and bottom sides of the element or content.
Example: 10
- Opacitystring, Required
Values between 0 to 100. ‘0’ is entirely transparent—100 for full opacity.
Example: 100
- PagesString, Required
- Specify page indices as comma-separated values or ranges to process (e.g. “0, 1, 2-” or “1, 2, 3-7”).
- If not specified, the default configuration processes all pages. The input must be in string format.
- Height in mmString, Required
Image height in millimeters (mm). If 0, default height or aspect ratio sized height will be taken.
Example: 60
- Width in mmString, Required
Image width in millimeters (mm). If 0, default width or aspect ratio sized width will be taken.
Example: 60
- Height in pxString, Required
Height of the image stamp in points(px)
Examplex: 60
- Width in pxString, Required
Width of the image stamp in points(px)
Example: 60
- isBackgroundboolean, RequiredDefault: true
Indicates whether the element should be placed in the background layer
- true
- false
- showOnlyInPrintboolean, RequiredDefault: false
Determines whether the element should be visible only in printed or export-to-PDF versions, and hidden on screen
- true
- false
Output
- File ContentBinary
Output file content from PDF4me action
- File NameString
Output file name from PDF4me action
Header
Content-Type:application/json
Authorization: Please copy key from the link.
Payload
{
"alignX": "center",
"alignY": "top",
"docContent": "Please put PDF base64 content",
"docName": "output.pdf",
"imageName": "stamp.jpg",
"imageFile": "Please put image base64 content",
"pages": "2",
"heightInMM": "60",
"widthInMM": "60",
"heightInPx": "60",
"widthInPx": "60",
"marginXInMM": "20",
"marginYInMM": "20",
"marginXInPx": "10",
"marginYInPx": "10",
"opacity": "100",
"isBackground": true,
"showOnlyInPrint": false
}
PDF4me api samples
- CSharp(C#)
- Java
- JavaScript
- Python
- Salesforce
- n8n
- Google Script
- AWS Lambda