PDF-XChange - Tracker PDF Viewer - TIFF-XChange - Image-XChange - XMF-XChange - Raster-XChange - Support

Moderators: TrackerSupp-Daniel, Tracker Support, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Tracker Supp-Stefan

 
pmazurk
User
Topic Author
Posts: 27
Joined: Tue Feb 22, 2011 10:25 pm

pxoPageList - how to use

Sat Dec 01, 2018 2:02 am

All the examples I've seen set pxoPageList to IntPtr.Zero which processes all pages. I need to examine the OCR results of a PDF one page at a time. I've tried a few ways of setting pxoPageList (such as pxoPagelist = Marshal.AllocHGlobal(Len(intPageNumber.ToString)) and pxoPagelist = Marshal.StringToHGlobalAnsi(intPageNumber.ToString) ) but I can't get any to work. When I use IntPtr.Zero, the OCR_GetText function works great. Any other setting causes an Access Violation. Would you be kind enough to share some sample VB.Net code that shows how pxoPageList should be set to process a particular page of a PDF?
 
pmazurk
User
Topic Author
Posts: 27
Joined: Tue Feb 22, 2011 10:25 pm

Re: pxoPageList - how to use

Sat Dec 01, 2018 10:00 pm

Never mind. I figured out that I needed to add

<DllImport(DLLName)>
Public Shared Function OCR_NewPagelist(ByRef pagelist As IntPtr) As Integer
End Function

<DllImport(DLLName)>
Public Shared Function OCR_AddPage(ByVal pagelist As IntPtr, ByVal PageNumber As Integer) As Integer
End Function

to PDFXOCR_Funcs. Took some effort to figure that out from the C-oriented help files, but I finally got there.
 
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13077
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: pxoPageList - how to use

Thu Dec 06, 2018 1:20 pm

Hello pmazurk,

Glad to hear you found the solution!

Regards,
Stefan

Who is online

Users browsing this forum: No registered users and 3 guests