Examples of consolidateNamedDestinations()


Examples of com.lowagie.text.pdf.PdfReader.consolidateNamedDestinations()

      if (getValue("destfile") == null) throw new InstantiationException("You need to choose a destination PDF file");
            FileInputStream bmReader = new FileInputStream( (File) getValue("xmlfile") );
            List<HashMap<String, Object>> bookmarks = SimpleBookmark.importFromXML( bmReader );
            bmReader.close();
            PdfReader reader = new PdfReader(((File)getValue("pdffile")).getAbsolutePath());
            reader.consolidateNamedDestinations();
            PdfStamper stamper = new PdfStamper(reader, new FileOutputStream((File)getValue("destfile")));
            stamper.setOutlines(bookmarks);
            stamper.setViewerPreferences(reader.getSimpleViewerPreferences() | PdfWriter.PageModeUseOutlines);
            stamper.close();
    }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfReader.consolidateNamedDestinations()

            Document document = null;
            PdfCopy  writer = null;
            for (int i = 0; i < 2; i++) {
              // we create a reader for a certain document
                PdfReader reader = new PdfReader(files[i]);
                reader.consolidateNamedDestinations();
                // we retrieve the total number of pages
                int n = reader.getNumberOfPages();
                List<HashMap<String, Object>> bookmarks = SimpleBookmark.getBookmark(reader);
                if (bookmarks != null) {
                    if (pageOffset != 0)
View Full Code Here

Examples of com.lowagie.text.pdf.PdfReader.consolidateNamedDestinations()

  public void execute() {
    try {
      if (getValue("xmlfile") == null) throw new InstantiationException("You need to choose an xml file");
      if (getValue("pdffile") == null) throw new InstantiationException("You need to choose a source PDF file");
      PdfReader reader = new PdfReader(((File)getValue("pdffile")).getAbsolutePath());
            reader.consolidateNamedDestinations();
            List<HashMap<String, Object>> bookmarks = SimpleBookmark.getBookmark( reader );
            // save them in XML format
            FileOutputStream bmWriter = new FileOutputStream( (File)getValue("xmlfile") );
            SimpleBookmark.exportToXML(bookmarks, bmWriter, "UTF-8", false);
            bmWriter.close();
View Full Code Here

Examples of com.lowagie.text.pdf.PdfReader.consolidateNamedDestinations()

            Document document = null;
            PdfCopy writer = null;
            for (int i = 0; i < files.length; i++) {
                // we create a reader for a certain document
                PdfReader reader = new PdfReader(files[i].getAbsolutePath());
                reader.consolidateNamedDestinations();
                // we retrieve the total number of pages
                int n = reader.getNumberOfPages();
                List<HashMap<String, Object>> bookmarks = SimpleBookmark.getBookmark(reader);
                if (bookmarks != null) {
                    if (pageOffset != 0) {
View Full Code Here

Examples of com.lowagie.text.pdf.PdfReader.consolidateNamedDestinations()

                Document document = null;
                PdfCopy  writer = null;
                while (f < args.length-1) {
                    // we create a reader for a certain document
                    PdfReader reader = new PdfReader(args[f]);
                    reader.consolidateNamedDestinations();
                    // we retrieve the total number of pages
                    int n = reader.getNumberOfPages();
                    List bookmarks = SimpleBookmark.getBookmark(reader);
                    if (bookmarks != null) {
                        if (pageOffset != 0)
View Full Code Here

Examples of com.lowagie.text.pdf.PdfReader.consolidateNamedDestinations()

   
   
    PDFDocument doc = toPDFDocument(source, password, null);
    doc.setPages(pages);
    PdfReader reader = doc.getPdfReader();
    reader.consolidateNamedDestinations();
    boolean destIsSource = destination!=null && doc.getResource()!=null && destination.equals(doc.getResource());
    java.util.List bookmarks = SimpleBookmark.getBookmark(reader);
      ArrayList master = new ArrayList()
    if(bookmarks!=null)master.addAll(bookmarks);
     
View Full Code Here

Examples of com.lowagie.text.pdf.PdfReader.consolidateNamedDestinations()

                Document document = null;
                PdfCopy  writer = null;
                while (f < args.length-1) {
                    // we create a reader for a certain document
                    PdfReader reader = new PdfReader(args[f]);
                    reader.consolidateNamedDestinations();
                    // we retrieve the total number of pages
                    int n = reader.getNumberOfPages();
                    List bookmarks = SimpleBookmark.getBookmark(reader);
                    if (bookmarks != null) {
                        if (pageOffset != 0)
View Full Code Here

Examples of com.lowagie.text.pdf.PdfReader.consolidateNamedDestinations()

        }
        catch(Throwable t) {
          if(!stopOnError)continue;
          throw Caster.toPageException(t);
        }
        reader.consolidateNamedDestinations();
       
        // we retrieve the total number of pages
        int n = reader.getNumberOfPages();
        List bookmarks = keepBookmark?SimpleBookmark.getBookmark(reader):null;
        if (bookmarks != null) {
View Full Code Here

Examples of com.lowagie.text.pdf.PdfReader.consolidateNamedDestinations()

          }
        }
        response.setHeader("Content-disposition", "attachment" + "; filename=" + filename);
        // we create a reader for a certain document
        PdfReader reader = new PdfReader(reports[f].getTargetLocation());
        reader.consolidateNamedDestinations();
        // we retrieve the total number of pages
        int n = reader.getNumberOfPages();
        pageOffset += n;

        if (f == 0) {
View Full Code Here

Examples of com.lowagie.text.pdf.PdfReader.consolidateNamedDestinations()

                Document document = null;
                PdfCopy  writer = null;
                while (f < args.length-1) {
                    // we create a reader for a certain document
                    PdfReader reader = new PdfReader(args[f]);
                    reader.consolidateNamedDestinations();
                    // we retrieve the total number of pages
                    int n = reader.getNumberOfPages();
                    List bookmarks = SimpleBookmark.getBookmark(reader);
                    if (bookmarks != null) {
                        if (pageOffset != 0)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.