Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Open PDF on a specified section

More
IP: 194.28.116.213 6 years 4 months ago #14998 by robaba
Hi,
from your Android sdk i know how to open a pdf on a specified page i.e. by suppling in the Android 's intent a page.
Is there another way to open a pdf on a certain "section"? For example by setting a TOC's element? How can i achieve that?
More
IP: 93.36.222.154 6 years 4 months ago #15000 by nermeen
The demo project expects only a page index.

You can implement this by for example, saving the page index that corresponds to the TOC element somewhere and pass that to the intent. Or you can after openning the document scan the TOC and search for that TOC element and get the page to navigate to.
More
IP: 194.28.116.213 6 years 4 months ago #15001 by robaba
By reading the docs section and the knowledge base i can't find an example of that.
Can you provide a sample of "scan the TOC and search for that TOC element and get the page to navigate to", please?
More
IP: 93.36.222.154 6 years 4 months ago #15004 by nermeen
Something like:
Code:
private void scanOutlines(Document.Outline parent) { for (Document.Outline root = parent; root != null; root = root.GetNext()) { //some check here if(root.GetTitle().equals("xxx")) { m_view.PDFGotoPage(root.GetDest()); break; } if(root.GetChild() != null) scanOutlines(root.GetChild()); } }

And call it like:
Code:
if(m_doc.GetOutlines() != null) scanOutlines(m_doc.GetOutlines());
Time to create page: 0.450 seconds
Powered by Kunena Forum