The DomPDFAddOutlineFromFile function is used to add an outline/bookmark of pages to an existing PDF file where the entries and page links are specified by an external text 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 DomPDFAddOutlineFromFile Lib "DOMINOPDF.DLL" (Byval szInput As String, Byval szOutline As String, Byval szTitle As String) 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
szOutline - The file name and path of the outline text file.
For example;
c:\outline.txt
c:\my documents\outline.txt
The outline text file should structured so each outline entry is on a new line and indicates the outline entry text and the page number link separated by a pipe character (|).
For example;
Meeting Notes|1
Summary|2
LotusScript can be used to write the values out to the file as in the example below.
Sub Initialize
Dim fileNum As Integer
Dim fileName As String
fileNum% = Freefile()
fileName$ = "c:\outline.txt"
Open fileName$ For Output As fileNum%
Print #fileNum%, "Meeting Notes|1"
Print #fileNum%, "Summary|2"
Close fileNum%
szTitle - Specify the title of the root outline entry. If left blank will default to "Pages".
Examples
Sub Initialize
'Declare variables...
Dim sInput As String
'Set values...
sInput = |c:\test.PDF|
sOutline = |c:\test.txt|
'Error handler...
On Error Goto Error_Handler
'Add Text...
Call DomPDFAddOutlineFromFile(sInput, sOutline, "DominoPDF")
The_End:
Exit Sub
Error_Handler:
Print Error$
Resume The_End
End Sub