Table of content problem - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Android development and PDF
  • Page:
  • 1

TOPIC: Table of content problem

Table of content problem 3 years 4 months ago #9165

  • Gracanin
  • Gracanin's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 25
  • Thank you received: 0
Hi,

I'm having problems extracting TOC from PDF file. In my OnCreate method I'm trying to get outlines by using following code:

float top = document.GetPageHeight(0);
boolean ret = document.NewRootOutline("Root", 0, top);
if(ret)
{
Document.Outline ol = document.GetOutlines();
ol.AddChild("Child1", 0, top * 5 / 6);
Document.Outline ol1 = ol.GetChild();
ol1.AddNext("Child2", 0, top / 2);
}

Problem is that variable ret is always returning null... Do you have any suggestion how to solve this problem? Btw, I have professional licence.

Please Log in or Create an account to join the conversation.

Table of content problem 3 years 4 months ago #9168

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Karma: 17
  • Thank you received: 65
Hi,
the problem is that in the onCreate() of the demo project the document is not yet open.
If you try your code after the PDFOpen() method it should return true and work properly.

Please Log in or Create an account to join the conversation.

Table of content problem 3 years 4 months ago #9169

  • Gracanin
  • Gracanin's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 25
  • Thank you received: 0
Hi,
I tried to call it after PDFOpen() method, didn't work. Also, I tried to call it onButtonClick after PDF has opened, didn't work. Problem is always the same, document.NewRootOutline is returning false... Tried it on 3.4 and 3.5beta8 versions. Do you maybe have any other suggestions how to solve this?

P.S. PDF I'm testing on is showing TOC perfectly on iOS.

Please Log in or Create an account to join the conversation.

Table of content problem 3 years 4 months ago #9170

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Karma: 17
  • Thank you received: 65
Hi,
to use this method you need a Premium License.

Please Log in or Create an account to join the conversation.

Table of content problem 3 years 4 months ago #9171

  • Gracanin
  • Gracanin's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 25
  • Thank you received: 0
Hi,

is there any other option to get TOC with professional licence? In iOS there is method rootOutline, does something similar exist on Android?

Please Log in or Create an account to join the conversation.

Table of content problem 3 years 4 months ago #9172

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Karma: 17
  • Thank you received: 65
Hi,
with your license you can read table of contents using these getters methods: www.radaeepdf.com/documentation/javadocs...ocument.Outline.html

With a Premium license you can manipulate the TOC: www.radaeepdf.com/ecommerce/technical-specification
The following user(s) said Thank You: Gracanin

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum