PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)
Moderators:PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
I had updated from V 1.x up to V2.0 (Build 42.2).
Now there is a problem with reading the page numbers correctly. There is only “0” displayed.
What can we do to solve this problem?
I think it's because of the gotoNamedDest function.
Please see this one (from the Adobe JS API reference), it worked for me, just the text output is in the console:
function DumpBookmark(bkm, nLevel)
{
var s = "";
for (var i = 0; i < nLevel; i++) s += " ";
console.println(s + "+-" + bkm.name);
if (bkm.children != null)
for (var i = 0; i < bkm.children.length; i++)
DumpBookmark(bkm.children[i], nLevel + 1);
}
console.clear(); console.show();
console.println("Dumping all bookmarks in the document.");
DumpBookmark(this.bookmarkRoot, 0);
the problem persists.
I tried to solve the problem by presenting it in different discussion fora, unfortunately without success.
Some time ago I had the same problem. In that case it was solved by updating the components of the "PDF xChange Viewer".
Here is the real problem. It will be fixed in the next build.
1. Temporary workaround, please display bookmarks pane before bookmarks enumeration.
2. Small fix for your code:
replace:
I downloaded the mostrecent update of the pdf-component. However, the problem stillconsists.
At first, I displayed the navigation and then Iread-out the pages.
I adapted the code according to yourexplanation. However, there remain some problems to be solved.
1. Has the pdf-component to be in the visible area in order toread-out the page numbers?
2. The read-out page numbers of the bookmarks sometimes do not coincidewith the real page numbers.
Will this problem be solved in the next update? If so, when will thatcome out?
Hi Heiko,
In the new build there is no need to display the bookmarks pane for reading bookmarks, and viewer component does not need to be in the visible area. Also please note that page numbers are displayed by JS which is zero based, so to see the real page number you should add 1.
Hi,
Sorry but we cannot reproduce such problem here.
We would be grateful if you could send us sample project and PDF file, so we can reproduce your problem here, pls include a link back to the topic here in your email for reference.