Code: Select all
// HDC CDICreateDC( HANDLE hPrinter );
Function uLong CDICreateDC (Long hPrinter ) Library "cdintf300.dll" alias for "CDICreateDC;Ansi"
// long SetBookmark( HANDLE hDC, long lParent, LPCSTR szTitle );
Function Long SetBookmark(uLong hDC, long lParent, string szTitle ) Library "cdintf300.dll" alias for "SetBookmark;Ansi"
Code: Select all
// Your code for initializing Amyuni CDI print system goes here...
// --- Print ---//
long Job, x
ulong printerDC
// Start a new job and a new page.
Job = PrintOpen()
// Print the text.
x = PrintText(Job,"The material ", 2000, 4000)
ll_rc = Print(Job, x, " in this report")
ll_rc = Print(Job, 2000, "is not confidential and ")
ll_rc = Print(Job, 2000, "may be freely disclosed ")
ll_rc = Print(Job, 2000, " ")
for ll_row = 1 to 5
ll_rc = Print(Job, 2000, "This should be bookmark " + string( ll_row ) )
ls_error = of_get_error()
ll_rc = Print(Job, 2000, " ")
printerDC = CDICreateDC (ll_pdfprinter)
ll_rc = SetBookmark(printerDC, 0, "Bookmark " + string( ll_row ) )
ll_rc = Print(Job, 2000, " ")
ls_error = of_get_error()
next
ll_rc = PrintClose(Job)
// Your code to shutdown Amyuni CDI print system goes here...
it does!The material in this report
is not confidential and
may be freely disclosed
This should be bookmark 1
This should be bookmark 2
This should be bookmark 3
This should be bookmark 4
This should be bookmark 5
What it doesn't do is add 5 bookmarks.
Can you use CDICreateDC and SetBookmark with PowerBuilder?
I assumed that CDICreateDC would get a device context from the print driver and create a bookmark at each place where I invoke SetBookmark.