Package org.pdfclown.documents.interaction.navigation.document

Examples of org.pdfclown.documents.interaction.navigation.document.Bookmarks


    )
  {
    Pages pages = document.getPages();

    // Bookmarks.
    Bookmarks bookmarks = new Bookmarks(document);
    document.setBookmarks(bookmarks);
    document.setPageMode(PageModeEnum.Bookmarks);
    Page page = pages.get(0);
    Bookmark rootBookmark = new Bookmark(
      document,
      "Creation Sample",
      new LocalDestination(
        page,
        Destination.ModeEnum.Fit,
        null
        )
      );
    bookmarks.add(rootBookmark);
    bookmarks = rootBookmark.getBookmarks();
    page = pages.get(1);
    Bookmark bookmark = new Bookmark(
      document,
      "2nd page (close-up view)",
      new LocalDestination(
        page,
        Destination.ModeEnum.XYZ,
        new Float[]{0f,250f,2f}
        )
      );
    bookmarks.add(bookmark);
    bookmark.getBookmarks().add(
      new Bookmark(
        document,
        "2nd page (mid view)",
        new LocalDestination(
          page,
          Destination.ModeEnum.XYZ,
          new Float[]{0f,(float)page.getSize().getHeight() - 250,1f}
          )
        )
      );
    page = pages.get(2);
    bookmarks.add(
      new Bookmark(
        document,
        "3rd page (fit horizontal view)",
        new LocalDestination(
          page,
          Destination.ModeEnum.FitHorizontal,
          new Float[]{0f}
          )
        )
      );
    try
    {
      bookmarks.add(
        bookmark = new Bookmark(
          document,
          "PDF Clown Home Page",
          new GoToURI(document, new URI("http://www.pdfclown.org"))
          )
View Full Code Here


  {
    PdfDirectObject bookmarksObject = getBaseDataObject().get(PdfName.Outlines);
    if(bookmarksObject == null)
      return null;

    return new Bookmarks(bookmarksObject);
  }
View Full Code Here

    {throw new RuntimeException(filePath + " file access error.",e);}

    Document document = file.getDocument();

    // 2. Get the bookmarks collection!
    Bookmarks bookmarks = document.getBookmarks();
    if(bookmarks == null)
    {System.out.println("\nNo bookmark available (Outline dictionary not found).");}
    else
    {
      System.out.println("\nIterating through the bookmarks collection (please wait)...\n");
View Full Code Here

TOP

Related Classes of org.pdfclown.documents.interaction.navigation.document.Bookmarks

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.