Image Viewer CP 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 Integer, _
   ByVal iImageID As Integer, _
   ByVal iLeft As Integer, _
   ByVal iTop As Integer, _
   ByVal iWidthScale As double, _
   ByVal iHeightScale As double  
) 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 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-top 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
ImageViewer1.PDFOutputPDFA = True
ImageViewer1.PDFInitAnnotation
imageId = ImageViewer1.PDFAddImageFromFile("C:\myfolder\sample.jpg")
If imageId <> -1 Then
   ImageViewer1.PDFDrawImage 0, imageId, 150000, 30000, 0.1, 0.1
End If