Hi afalsow,
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.
Code: Select all
HRESULT res;
DWORD Ocnt;
PDFDocument pdf_new = NULL;
LPCSTR g_initstr = "<Enter here valid key>";
LPCSTR g_initDevCode = "<Enter here valid developer's code>";
LPCSTR FileName = "C:\\testFile.PDF";
HPDFOBJECT hPdfObj;
res = PXCp_Init(&pdf_new, g_initstr, g_initDevCode);
res = PXCp_ReadDocumentA(pdf_new, FileName, 0);
res = PXCp_ET_Prepare(pdf_new);
res = PXCp_ET_AnalyzePageContent(pdf_new, 0);
res = PXCp_GetPagesCount(pdf_new, &Ocnt);
res = PXCp_llGetObjectsCount(pdf_new, &Ocnt);
res = PXCp_llGetObjectByIndex(pdf_new, 1, &hPdfObj);
res = PXCp_ET_Finish(pdf_new);
Thanks.
Sincerely,