Image Viewer CP ActiveX Control

PDFAddImageFromFile

 

Adds image (JPEG, TIFF, PNG) to the PDF file. Before you draw the image, you must add image to the PDF file first.

Public Function PDFAddImageFromFile( _
   ByVal strImageFile As String
) As long

 

Parameter

strImageFile
   the path of image file. It support bmp and jpg files.


Return Value

Return the image ID.

Example

   

Visual Basic Syntax
ImageViewer1.PDFInitAnnotation
imageId = ImageViewer1.PDFAddImageFromFile("C:\myfolder\sample.jpg")
If imageId <> -1 Then
   ImageViewer1.PDFDrawImage 0, imageId, 50000, 10000, 50000, 50000
   ImageViewer1.PDFDrawImage 0, imageId, 50000, 60000, 32000, 24000
End If