Issue with PXCp_GetDocumentInfoExW

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Andrew - Tracker Support, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Post Reply
docu-track99
User
Posts: 495
Joined: Thu Dec 06, 2007 8:13 pm

Issue with PXCp_GetDocumentInfoExW

Post by docu-track99 » Mon Mar 24, 2008 3:10 pm

I've been having issues reading custom information from just one specific PDF. It will read a few keys fine, then crash at others (not always the same key being read).

I've included a small program and the PDF to demonstrate this.
Attachments
PDF Error.zip
(906.44 KiB) Downloaded 206 times

Ivan - Tracker Software
Site Admin
Posts: 3607
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Post by Ivan - Tracker Software » Tue Mar 25, 2008 8:32 am

The problem is into your class function GetCustomInformation. Please try with this internal loop rewritten:

Code: Select all

9      For i = 0 To 500
10          lLen1 = 0
            lLen2 = 0
11          sKeyIn = ""
12          res = PXCp_GetDocumentInfoExW(nSelectedDocument, i, sKeyIn, lLen1, sString, lLen2)
13          If lLen1 = 0 Then
14              lLen2 = 0
15              sString = ""
'16              Exit For
            Else
18              sKeyIn = Space((lLen1 - 1) * 2)
                lLen2 = 0
19              res = PXCp_GetDocumentInfoExW(nSelectedDocument, i, sKeyIn, lLen1, sString, lLen2)
20              If StrConv(sKeyIn, vbFromUnicode) = sKey Then
21                  bFound = True
22                  Exit For
23              End If
17          End If
24      Next
P.S. To be honest, this function can be optimized, but it is your code :)
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.

docu-track99
User
Posts: 495
Joined: Thu Dec 06, 2007 8:13 pm

Post by docu-track99 » Tue Mar 25, 2008 6:02 pm

That worked, thank you very much!

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Tue Mar 25, 2008 6:12 pm

Pleasure :)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

Post Reply