easyPDF SDK Usermanual
PDF Creator Programming API  |  Download Free Trial  |  Contact Us to Purchase

AddRubberStamp Method

Adds a rubber stamp to a PDF file.

Sub AddRubberStamp(InputFileName As String,
                   OutputFileName As String,
                   From As Long,
                   To As Long,
                   Left As Double,
                   Top As Double,
                   Right As Double,
                   Bottom As Double,
                   Text As String,
                   Author As String,
                   Subject As String,
                   Icon As prcStampIcon,
                   Color As OLE_COLOR)

void AddRubberStamp(string InputFileName,
                    string OutputFileName,
                    int From,
                    int To,
                    double Left,
                    double Top,
                    double Right,
                    double Bottom,
                    string Text,
                    string Author,
                    string Subject,
                    prcStampIcon Icon,
                    System.UInt32 Color)

void AddRubberStamp(String InputFileName,
                    String OutputFileName,
                    int From,
                    int To,
                    double Left,
                    double Top,
                    double Right,
                    double Bottom,
                    String Text,
                    String Author,
                    String Subject,
                    prcStampIcon Icon,
                    int Color) throws PDFProcessorException


Return Values



Note 1: Coordinate system information:

  1. The unit size of PDF user space is 1/72 inch (1 inch = 72 PDF user space unit).
  2. The location of the origin (0, 0) is at top-left corner.
  3. To get page size information from a PDF file, use GetPageSize method.

    The page number uses zero-based index, meaning that page number starts from 0.

Note 2: OLE_COLOR conversion from various programming languages:


static_cast<OLE_COLOR>(RGB(0, 0, 255))


RGB(0, 0, 255)


Convert.ToUInt32(System.Drawing.ColorTranslator.ToOle(Color.FromArgb(0, 0, 255))


(uint)System.Drawing.ColorTranslator.ToOle(Color.FromArgb(0, 0, 255))


32 bit integer value in following format: 0x00bbggrr (in BGR format, not in RGB)

For more information about color translation, refer to MSDN Knowledge Base article Q131101.

Note 3: Since the actual size of stamp image varies among different PDF viewers, the stamp image will not fit exactly with the bounding box you specify (but it will be placed somewhere within the bounding box at least).

Note 4: AddRubberStamp will ignore any page rotation that already exists. The practical implication of this is that one cannot call RotatePages followed by AddRubberStamp in order to apply an angled rubber stamp; in such a scenario, the output would appear as if the stamp were applied first and the page were rotated afterward. In other words, calling RotatePages and then AddRubberStamp will result in the same output as if you had called AddRubberStamp and then RotatePages.

Example Usage

Set oProcessor = CreateObject("easyPDF.PDFProcessor.8")
oProcessor.AddRubberStamp "C:\test\input.pdf", _
                          "C:\test\output.pdf", _
                          0, _
                          0, _
                          100, _
                          10, _
                          300, _
                          100, _
                          "Note text here." + vbCR + vbCR + "Line break with CR is allowed", _
                          "Author", _
                          "Subject", _
                          RGB(0, 255, 0)