Navigation:  DominoPDF > Helper Functions >

Function: DomPDFAddImage

Previous pageReturn to chapter overviewNext page

The DomPDFAddImage function is used to add images to an existing PDF file.

Note: The function does not support processing an already encrypted PDF file. If processing of an already encrypted PDF file is required please contact Primeapple for details.

LOTUSSCRIPT

Declarations

Declare Function DomPDFAddImage Lib "DOMINOPDF.DLL" (Byval szInput As String, Byval szImage As String,_

Byval szPages As String, Byval iLeft As Double, Byval iTop As Double,_

Byval iWidth As Double, Byval iHeight As Double) As Long

Return Value

Returns 0 if successful or -1 if unsuccessful.

Syntax

szInput - The file name and path of the PDF file to be opened.

For example;

c:\contacts.pdf

c:\my documents\contacts.pdf

szImage - The file name and path of the image file to be added.

For example;

c:\contacts.gif

c:\my documents\contacts.jpg

szPages - Specify the pages in the PDF on which to add the image.

The szPages parameter has been defined as a string variable so a range of pages can be specified.

If szPages are left blank (for example "") all pages in the PDF document will be affected.

If szPages denotes a single page (for example "1") the specified page will be affected.

If szPages denoted a range of pages (for example "1, 3-4, 7") the specified range of pages will be affected.

iLeft - The left position to begin image output.

iTop - The top position to begin image output.

iWidth - The width of the image output. If set as zero (0) the original image width is used.

iHeight - The height of the image output. If set as zero (0) the original image height is used.

Examples

Sub Initialize

'Declare variables...

Dim sInput As String

 

'Set values...

sInput = |c:\test.PDF|

 

'Error handler...

On Error Goto Error_Handler

 

'Add Image...

Call DomPDFAddImage(sInput, "c:\logo.gif", "1", 10, 10, 0, 0)

 

The_End:

Exit Sub

 

Error_Handler:

Print Error$

Resume The_End

End Sub