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

StampPDFonPDF Method

Add image stamp

Sub StampPDFonPDF(StampFileName As String,
                  StampPassword As String,
                  StampPageNo As Long,
                  InputPageNo As Long,
                  Left As Double,
                  Top As Double,
                  Zoom As Double,
                  FillWhite As Boolean)

void StampPDFonPDF(string StampFileName,
                   string StampPassword,
                   int StampPageNo,
                   int InputPageNo,
                   double Left,
                   double Top,
                   double Zoom,
                   bool FillWhite)

void StampPDFonPDF(String StampFileName,
                   String StampPassword,
                   int StampPageNo,
                   int InputPageNo,
                   double Left,
                   double Top,
                   double Zoom,
                   boolean FillWhite) throws PDFProcessorException


Return Values



Note 1: Coordinate system information:

  1. The stamp coordinates are specified in points. 1 point is 1/72 inch (1 inch is 72 points, or 25.4 millimeters).
  2. The location of the origin (0, 0) is at top-left corner.

Note 2: White fill information:

In PDF every blank page is assumed to have a solid white background. In most PDF files pages don't include an explicit white fill, because that is always implied regardless.

However, when you stamp a PDF on another PDF, normally only the explicitly present drawing entities are transferred from the source to the destination. That allows you to optionally make the stamp page transparent.

If FillWhite is True, the function explicitly fills the background of the stamp page with a solid white brush, to ensure that the stamped page looks exactly like the original one. This is very useful for office documents, books, forms, printed matter, or any document with an implied white background.

If FillWhite is False, the function does not insert a white fill, thus the stamp becomes transparent. This is very useful for artwork and logo designs, which you might want to stamp transparently. In this case only the explicitly present drawing entities are stamped.

Note, however, that if the original stamp page already includes an explicit white fill, then transparency can no longer be achieved.

If in doubt, you should set FillWhite to True, because that ensures that the stamped content will look identical to the original PDF (i.e. with a guaranteed solid white background layer).

Also note that FillWhite = True generates a 100% white background in DeviceGray color space, which does not include color management capabilities.

Example Usage

Set oProcessor = CreateObject("easyPDF.PDFProcessor.8")
Set oProcessorHandle = oProcessor.OpenFile("C:\test\input.pdf", "C:\test\output.pdf")
oProcessorHandle.StampPDFonPDF "c:\test\stamp.pdf", "", 0, 1, 36, 72, 100, True
                               ' ""  : no password
                               ' 0   : stamp the first page of stamp.pdf
                               ' 1   : on the second page of input.pdf
                               ' 36  : horizontally at half inch (12.7 mm)
                               ' 72  : vertically at 1 inch (25.4 mm)
                               ' 100 : at 100% (1:1) scaling
                               ' True: with a solid white background