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 or PDF-XChange Viewer SDK if appropriate.
I've only begun experimenting with the SDK a few days ago, working with the sample VB_XCPro40Demo. I've simply added a small sub to do my tinkering... one function at a time.
Private Sub Command1_Click()
Dim res As Long
Dim pdf_new As Long
Dim Ocnt As Long
res = PXCp_Init(pdf_new, g_initstr, g_initDevCode)
res = PXCpVB_ReadDocumentW(pdf_new, "e:\!test.pdf", 0) '[ 4 pages ]
res = PXCp_ET_Prepare(pdf_new)
res = PXCp_ET_AnalyzePageContent(pdf_new, 1)
res = PXCp_GetPagesCount(pdf_new, Ocnt)
res = PXCp_llGetObjectsCount(pdf_new, Ocnt)
res = PXCp_llGetObjectByIndex(pdf_new, 1, Ocnt)
res = PXCp_ET_Finish(pdf_new)
Thank you for your post.
Please let me ask you why are you analyzing the second page and not starting from the first page which is page number 0?
Try with the following:
res = PXCp_ET_AnalyzePageContent(pdf_new, 0);
res = PXCp_ET_AnalyzePageContent(pdf_new, 1);
No change in behavior. Same results at every function/step.
As to why I was analyzing 1 instead of 0... just an arbitrary selection. Based on documentation (your function PXCp_ET_AnalyzePageContent appears to deal primarily with text elements), I felt the function may not even be necessary as a preparatory step for executing PXCp_llGetObjectByIndex.
At this point in experimentation, my goal is simply to access each object to see what information is available for each object.
Thank you for your reply.
Are you sure your pdf document is a valid one?
I'm running this code snippet that is identical to yours without any issues.
Also make sure this function works properly: res = PXCpVB_ReadDocumentW(pdf_new, "e:\!test.pdf", 0)
The name "!test.pdf" is not a proper name for a pdf document.
Adding special characters to file names is not a standard practice.
The pdf file is valid. It opens properly and displays completely properly in Adobe Reader.
Yes, res = PXCpVB_ReadDocumentW(pdf_new, "e:\!test.pdf", 0) executes properly. (I use "!" to indicate the file is for testing, and so it places high in file directory listings... just a matter of convenience during testing)
The pagecount returned is 4, which is correct.
I have renamed the file to "test.pdf" and run my sample.
There is no change in results.
I notice your code is C; mine is VB. Have you tried this in a VB sample?
Yes, I ran it in VB.NET and everything works fine.
Please could you show me the DLL import of those functions in Visual Basic?
Are you sure they are well defined? For example, arguments are properly passed by reference and by value, types agree, etc.