Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

How to implement Bookmark? 11 years 2 months ago #1304

  • callsamik
  • callsamik's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
How to implement Bookmark using this SDK ?
The topic has been locked.

How to implement Bookmark? 11 years 2 months ago #1306

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
bookmark in PDF file or out of PDF file?
using Document.getOutline to get outlines.

if you need bookmarks out of PDF, you can using class BMDatabase
The topic has been locked.

How to implement Bookmark? 11 years 2 months ago #1322

  • callsamik
  • callsamik's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
I'm trying to add bookmark to an opened PDF and after that also want to show a list of all bokkmarks.. Can you suggest how to proceed?
The topic has been locked.

How to implement Bookmark? 11 years 2 months ago #1326

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
OK, it think you'd better record bookmark using SQLLite or XML?
The topic has been locked.

How to implement Bookmark? 7 years 7 months ago #11105

  • mrawy
  • mrawy's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
Hello,
I implemented add outline like this:
public boolean addToBookmarks() {

        boolean success;

        float top = mDocument.GetPageHeight(0);

        Document.Outline outline = mDocument.GetOutlines();

        if (outline == null) {

            success = mDocument.NewRootOutline(String.valueOf(mCurrentPage), mCurrentPage, top);

            if (success) {

                pdfSave();

                outline = mDocument.GetOutlines();

            }

        }

        success = outline != null && outline.AddChild(String.valueOf(mCurrentPage), mCurrentPage, top);

        if (success) {

            success = pdfSave();

        }

        return success;
    }
The problem is when i close the PDF after adding outlines and re-open it i can not get the outlines:
private void fetchOutlines() {

        if (mDocument == null) return;

        Document.Outline outline = mDocument.GetOutlines();//first root is always null 

        fetchOutlines(outline);

    }

    private void fetchOutlines(Document.Outline outline) {

        while (outline != null) {

            Toast.makeText(mActivity, "" + outline.GetDest(), Toast.LENGTH_SHORT).show();

            mOutlines.add(outline);

            Document.Outline child = outline.GetChild();

            if (child != null) {

                fetchOutlines(child);

            }

            outline = outline.GetNext();

        }

    }
The topic has been locked.

How to implement Bookmark? 7 years 7 months ago #11115

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
Hello,

You need to make sure of the following:
  1. You have an activated premium license, to be able to change/add/remove the outline
  2. To re-open them make sure that the document is opened

Did you try this in the demo project or yours? and which version?

Note: i suggest you to create a new post as this one is very old.
The topic has been locked.
  • Page:
  • 1
Powered by Kunena Forum