Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfImportedPage


          new FileOutputStream(dest));
      // step 3: we open the document
      document.open();
      // step 4: adding the content
      PdfContentByte cb = writer.getDirectContent();
      PdfImportedPage page;
      float offsetX, offsetY;
      int p;
      for (int i = 0; i < total; i++) {
        p = i + 1;
        pageSize = reader.getPageSize(p);
View Full Code Here


                    writer = new PdfCopy(document, new FileOutputStream(pdf_file));
                    // step 3: we open the document
                    document.open();
                }
                // step 4: we add content
                PdfImportedPage page;
                for (int p = 0; p < n; ) {
                    ++p;
                    page = writer.getImportedPage(reader, p);
                    writer.addPage(page);
                    System.out.println("Processed page " + p);
View Full Code Here

      // step 2: we create a writer that listens to the document
      PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(dest));
      // step 3: we open the document
      document.open();
      PdfContentByte cb = writer.getDirectContent();
      PdfImportedPage page;
      int rotation;
      int i = 0;
      int p = 0;
      // step 4: we add content
      while (i < n) {
View Full Code Here

      int pages = reader.getNumberOfPages();
      System.err.println("The new file has " + pages + " pages.");
      Document document = new Document(reader.getPageSizeWithRotation(1));
      PdfCopy copy = new PdfCopy(document, new FileOutputStream(dest.getAbsolutePath()));
      document.open();
            PdfImportedPage page;
            for (int i = 0; i < pages; ) {
                ++i;
                System.out.println("Processed page " + i);
                page = copy.getImportedPage(reader, i);
                copy.addPage(page);
View Full Code Here

            // set pdf version
            setPdfVersionSettingOnWriter(inputCommand, pdfWriter, Character.valueOf(pdfReader.getPdfVersion()));

            currentDocument.open();
            PdfImportedPage importedPage = pdfWriter.getImportedPage(pdfReader, currentPage);
            pdfWriter.addPage(importedPage);
            currentDocument.close();
            FileUtility.renameTemporaryFile(tmpFile, outFile, inputCommand.isOverwrite());
            LOG.debug("File " + outFile.getCanonicalPath() + " created.");
            setPercentageOfWorkDone((currentPage * WorkDoneDataModel.MAX_PERGENTAGE) / n);
View Full Code Here

        int fileNum = 0;
        LOG.info("Found " + n + " pages in input pdf document.");
        int currentPage;
        Document currentDocument = new Document(pdfReader.getPageSizeWithRotation(1));
        boolean isTimeToClose = false;
        PdfImportedPage importedPage;
        File tmpFile = null;
        File outFile = null;
        for (currentPage = 1; currentPage <= n; currentPage++) {
            // check if i've to read one more page or to open a new doc
            isTimeToClose = ((currentPage != 1) && ((SplitParsedCommand.S_ODD.equals(inputCommand.getSplitType()) && ((currentPage % 2) != 0)) || (SplitParsedCommand.S_EVEN
View Full Code Here

        int currentPage;
        Document currentDocument = new Document(pdfReader.getPageSizeWithRotation(1));
        int relativeCurrentPage = 0;
        int endPage = n;
        int startPage = 1;
        PdfImportedPage importedPage;
        File tmpFile = null;
        File outFile = null;

        Iterator itr = limitsList.iterator();
        if (itr.hasNext()) {
View Full Code Here

        BookmarksProcessor bookmarkProcessor = new BookmarksProcessor(SimpleBookmark.getBookmark(pdfReader), n);
        int fileNum = 0;
        LOG.info("Found " + n + " pages in input pdf document.");
        int currentPage;
        Document currentDocument = new Document(pdfReader.getPageSizeWithRotation(1));
        PdfImportedPage importedPage;
        File tmpFile = null;
        File outFile = null;
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        int startPage = 0;
        int relativeCurrentPage = 0;
View Full Code Here

                setCompressionSettingOnWriter(inputCommand, pdfWriter);

                pdfDocument.addCreator(ConsoleServicesFacade.CREATOR);
                pdfDocument.open();

                PdfImportedPage page;

                boolean finished1 = false;
                boolean finished2 = false;
                int current1 = (inputCommand.isReverseFirst()) ? limits1[1] : limits1[0];
                int current2 = (inputCommand.isReverseSecond()) ? limits2[1] : limits2[0];
View Full Code Here

                    reader = new PdfReader(inputByteArray);
                }
                if (reader != null) {
                    int n = reader.getNumberOfPages();
                    for (int i=0; i < n; i++) {
                        PdfImportedPage pg = writer.getImportedPage(reader, i + 1);
                        //cb.addTemplate(pg, left, height * pgCnt);
                        writer.addPage(pg);
                        pgCnt++;
                    }
                }
View Full Code Here

TOP

Related Classes of com.lowagie.text.pdf.PdfImportedPage

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.