Examples of consolidateNamedDestinations()


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

         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)
            {
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()

      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()

            LwgDocument 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()

                LwgDocument 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()

        byte[] password = null;
        if((item.getPassword()) != null && (item.getPassword()).length()>0){
          password = item.getPassword().getBytes();
        }
        PdfReader pdfReader = new PdfReader(new RandomAccessFileOrArray(item.getInputFile().getAbsolutePath()),password);       
        pdfReader.consolidateNamedDestinations();
        List bookmarks = SimpleBookmark.getBookmark(pdfReader);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        SimpleBookmark.exportToXML(bookmarks, out, "UTF-8", false);
        ByteArrayInputStream input = new ByteArrayInputStream(out.toByteArray());     
        int maxDepth = PdfUtility.getMaxBookmarksDepth(input);
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 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 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()

      if (getValue("destfile") == null) throw new InstantiationException("You need to choose a destination PDF file");
            FileInputStream bmReader = new FileInputStream( (File) getValue("xmlfile") );
            List 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()

                LwgDocument 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.