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

AddStamp Method

Add image stamp

Sub AddStamp(InputFileName As String,
             OutputFileName As String,
             InputImageFileName As String,
             FirstPageOnly As Boolean,
             hpos As prcStampHPosition,
             vpos As prcStampVPosition,
             zorder As prcStampZOrder,
             hoffset As Double,
             voffset As Double,
             color As OLE_COLOR,
             zoom As Double)

void AddStamp(string InputFileName,
              string OutputFileName,
              string InputImageFileName,
              bool FirstPageOnly,
              prcStampHPosition hpos,
              prcStampVPosition vpos,
              prcStampZOrder zorder,
              double hoffset,
              double voffset,
              System.UInt32 color,
              double zoom)

void AddStamp(String InputFileName,
              String OutputFileName,
              String InputImageFileName,
              boolean FirstPageOnly,
              prcStampHPosition hpos,
              prcStampVPosition vpos,
              prcStampZOrder zorder,
              double hoffset,
              double voffset,
              int color,
              double zoom) throws PDFProcessorException

Parameters

Return Values

N/A.

Remarks

Note 1: It is very important that AddStamp can only make one exact color transparent. There's no tolerance.For this reason it is not recommended to use color key transparency with JPEG files, unless they are of very high quality.

Note 2: 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.

Note 3: OLE_COLOR conversion from various programming languages:

C++:

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

VB6:

RGB(0, 0, 255)

VB.NET:

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

C#:

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

Others:

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 4: Supported image formats are BMP and JPEG.

Example Usage

Set oProcessor = CreateObject("easyPDF.PDFProcessor.8")
 
oProcessor.AddStamp "C:\test\input.pdf", _
                    "C:\test\output.pdf", _
                    "c:\test\image.bmp", _ 
                    False, _ 
                    PRC_STAMP_HPOS_CENTER, _
                    PRC_STAMP_VPOS_CENTER, _
                    PRC_STAMP_ZORDER_TOP, _
                    0, _
                    0, _
                    RGB(255, 0, 0), _
                    100