I'm trying to create a pdf by merging a series of pdfs and add a bookmark for each pdf I've merged. I've got the merging working but when I go to create the root bookmark I'm getting an "Invalid argument" error This is VB 2010 with .Net 4
'open pdf
Dim intPdfManual As Integer
Dim res As Integer = XCPro40_Defs.PXCp_Init(intPdfManual, XCPro40_Defs.g_RegKey, XCPro40_Defs.g_DevCode)
res = XCPro40_Defs.PXCp_ReadDocumentW(intPdfManual, Manual.PdfPath, 0)
'ensure any prior bookmarks are cleared
res = XCPro40_Defs.PXCp_BMDeleteAllItems(intPdfManual)
'build root bookmark with min required info
Dim bmItem As New XCPro40_Defs.PXCp_BMInfo
bmItem.cbSize = XCPro40_Defs.PXCp_BMInfo_Size
bmItem.Mask = XCPro40_Defs.PXCp_BMInfoMask.BMIM_TitleW
bmItem.TitleW = System.Runtime.InteropServices.Marshal.StringToHGlobalUni("BookMark Root")
'insert root bookmark
Dim intRootBM As Integer
res = XCPro40_Defs.PXCp_BMInsertItem(intPdfManual, vbNull, XCPro40_Defs.PXCp_OutlinePos.PBM_ROOT, intRootBM, bmItem)
I know I just must be missing something obvious. any help is appreciated
Invalid argument creating root bookmark
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
-
- Site Admin
- Posts: 17960
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Invalid argument creating root bookmark
Hello Ben,
Did you see the code snippet provided on this page?
Seems like you are not specifying all the needed information for the bookmarks you are creating and that's why you are getting errors.
Regards,
Stefan
Did you see the code snippet provided on this page?
Seems like you are not specifying all the needed information for the bookmarks you are creating and that's why you are getting errors.
Regards,
Stefan