Add Page Number to PDF
Add page numbers to PDF in any format you like. You can also control the font size, position, format, etc using this action.
- Method: POST
- Endpoint: /api/v2/AddPageNumber
Parameters
- PDF File contentbase64, Required
Parameters for adding page numbers to PDF documents.
- PDF file namestring, Required
Source PDF file name with .pdf extension
- Page Number Formatstring
Choose or specify the format in which page numbers should appear.
- Page {pageNumber} - First Page Number Format
- Page {pageNumber} of {totalPages} - Second Page Number Format
- Custome - Third Page Number Format
- Horizontal Alignmentstring, Required
Choose how the content should be aligned horizontally:
Left – align content to the left edge
Center – align content in the center
Right – align content to the right edge"
- Vertical Alignmentstring, Required
Choose how the content should be aligned vertically:
Top – align content to the top edge
Middle – center content vertically
Bottom – align content to the bottom edge
- Horizontal Margin (mm) integer, Required
Specify the horizontal margin (in millimeters) between the left edge of the page or container and the starting position of the barcode.
Example: 2 mm
- Vertical Margin (mm)integer, Required
Specify the vertical margin (in millimeters) between the top edge of the page or container and the starting position of the barcode.
Example: 2 mm
- Font Sizeinteger, Required
Specify the font size to be used for displaying the page numbers.
Example: 12
- Set Boldboolean, Required
Choose whether the page numbers should be displayed in bold text:
true – Page numbers will appear in bold
false – Page numbers will appear in regular (normal weight) text
- Set Italicboolean, Required
Choose whether the page numbers should be displayed in italic style:
true – Page numbers will appear in italic
false – Page numbers will appear in normal (non-italic) text
- Skip First Pageboolean, Required
Choose whether to hide the page number on the first page of the document:
true – The first page will not show a page number
false – The first page will include a page number like all others
Output
- File ContentBinary
File content of the compressed document
- File NameString
File name of the compressed document
Header
Content-Type:application/json
Authorization: Please copy key from the link.
Payload
{
"alignX": "right",
"alignY": "bottom",
"docContent": "Please put PDF base64 content",
"docName": "output.pdf",
"fontSize": 12,
"pageNumberFormat": "# of {1}",
"marginXinMM": 2,
"marginYinMM": 2,
"isBold": true,
"isItalic": false,
"skipFirstPage": false
}
PDF4me api samples
- CSharp(C#)
- Java
- JavaScript
- Python
- Salesforce
- n8n
- Google Script
- AWS Lambda