Package org.pdfclown.documents

Examples of org.pdfclown.documents.Names


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

    Document document = file.getDocument();

    // 2. Named objects extraction.
    Names names = document.getNames();
    if(names == null)
    {System.out.println("No names dictionary.");}
    else
    {
      System.out.println("Names dictionary found (" + names.getContainer().getReference() + ")");

      NamedDestinations namedDestinations = names.getDestinations();
      if(namedDestinations == null)
      {System.out.println("No named destinations.");}
      else
      {
        System.out.println("Named destinations found (" + namedDestinations.getContainer().getReference() + ")");
View Full Code Here


    }
    Document document = file.getDocument();
    Pages pages = document.getPages();

    // 2. Inserting page destinations...
    Names names = document.getNames(); if(names == null){document.setNames(names = new Names(document));}
    NamedDestinations destinations = names.getDestinations(); if(destinations == null){names.setDestinations(destinations = new NamedDestinations(document));}
    destinations.put(new PdfString("First page"), new LocalDestination(pages.get(0)));
    if(pages.size() > 1)
    {
      destinations.put(new PdfString("Second page"), new LocalDestination(pages.get(1), Destination.ModeEnum.FitHorizontal, new Float[]{0f}));
View Full Code Here

TOP

Related Classes of org.pdfclown.documents.Names

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.