Scanner ActiveX Control

PDFDrawImage

 

Draw image on the specific page of PDF file. Before you draw the image, you must call PDFAddImageFromFile method add image to the PDF file first.

Public Function PDFDrawImage( _
   ByVal iPageNo As String, _
   ByVal iImageID As Integer, _
   ByVal iLeft As Integer, _
   ByVal iTop As Integer, _
   ByVal iWidth As Integer, _
   ByVal iHeight As Integer  
) As bool

 

Parameter

iPageNo
 specifies page no. for draw an image. The first page is zero index.

iImageID
 specifies the image ID.

The iLeft, iTop, iWidth, iHeight unit is Centimeters. 10000 = 1 CM.


iLeft
 specifies the x-coordinate of the upper-left corner of the image to draw.

iTop
 specifies the y-coordinate of the upper-left corner of the image to draw.

iWidthScale
 specifies scaling factor in x direction . 1.0 is 100% , 0.1 is 10%

iHeightScale
 specifies scaling factor in y direction. 1.0 is 100% , 0.1 is 10%



Return Value

Return true if successful.
Return false if failed.


Example

   

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