Scanner ActiveX Control

PDFAddImageFromFile2

 

Adds image (JPEG, TIFF, PNG) with chroma-key mask to the PDF file. Before you draw the image, you must add image to the PDF file first.

Public Function PDFAddImageFromFile2( _
   ByVal strImageFile As String ,_
    ByVal iRedMask As Integer ,_
    ByVal iGreenMask As Integer ,_
    ByVal iBlueMask As Integer ,_
    ByVal iThreshold As Integer ,_
) As long

 

Parameter

strImageFile
   the path of image file. It support JPEG, TIFF, PNG files.

iRedMask
   the red RGB value of color that should be masked.

iGreenMask
   the green RGB value of color that should be masked.

iBlueMask
   the blue RGB value of color that should be masked.

iThreshold
threshold colors are masked that are in the range [(r-threshold, r+threshold),(g-threshold, g+threshold),(b-threshold, b+threshold)], default is 0.


Return Value

Return the image ID.

Example

   

Visual Basic Syntax
Scanner1.PDFInitAnnotation
imageId = Scanner1.PDFAddImageFromFile2("C:\myfolder\sample.png,0,0,0,0")
If imageId <> -1 Then
   Scanner1.PDFDrawImage 0, imageId,10000, 10000, 1.0 ,1.0
End If
Scanner1.SaveAllPage2PDF "c:\newpage.pdf", True , 1