From 13d6dc3a6a5e8bd3c17997351a0e6f087eb301a2 Mon Sep 17 00:00:00 2001 From: tknall Date: Tue, 25 Nov 2008 12:04:30 +0000 Subject: Removing itext from source. git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@302 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- src/main/java/com/lowagie/tools/concat_pdf.java | 96 ------------------------- 1 file changed, 96 deletions(-) delete mode 100644 src/main/java/com/lowagie/tools/concat_pdf.java (limited to 'src/main/java/com/lowagie/tools/concat_pdf.java') diff --git a/src/main/java/com/lowagie/tools/concat_pdf.java b/src/main/java/com/lowagie/tools/concat_pdf.java deleted file mode 100644 index e9929a0..0000000 --- a/src/main/java/com/lowagie/tools/concat_pdf.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * $Id: concat_pdf.java,v 1.19 2006/04/28 16:26:38 psoares33 Exp $ - * $Name: $ - * - * This code is free software. It may only be copied or modified - * if you include the following copyright notice: - * - * This class by Mark Thompson. Copyright (c) 2002 Mark Thompson. - * - * This code is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * itext@lowagie.com - */ - -/** - * This class demonstrates copying a PDF file using iText. - * @author Mark Thompson - */ -package com.lowagie.tools; - -import java.io.*; - -import com.lowagie.text.Document; -import com.lowagie.text.pdf.*; -import java.util.List; -import java.util.ArrayList; - -/** - * Tool that can be used to concatenate existing PDF files. - */ -public class concat_pdf { - - /** - * This class can be used to concatenate existing PDF files. - * (This was an example known as PdfCopy.java) - * @param args the command line arguments - */ - public static void main(String args[]) { - if (args.length < 2) { - System.err.println("arguments: file1 [file2 ...] destfile"); - } - else { - try { - int pageOffset = 0; - ArrayList master = new ArrayList(); - int f = 0; - String outFile = args[args.length-1]; - 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) - SimpleBookmark.shiftPageNumbers(bookmarks, pageOffset, null); - master.addAll(bookmarks); - } - pageOffset += n; - System.out.println("There are " + n + " pages in " + args[f]); - - if (f == 0) { - // step 1: creation of a document-object - document = new Document(reader.getPageSizeWithRotation(1)); - // step 2: we create a writer that listens to the document - writer = new PdfCopy(document, new FileOutputStream(outFile)); - // step 3: we open the document - document.open(); - } - // step 4: we add content - PdfImportedPage page; - for (int i = 0; i < n; ) { - ++i; - page = writer.getImportedPage(reader, i); - writer.addPage(page); - System.out.println("Processed page " + i); - } - writer.freeReader(reader); - f++; - } - if (master.size() > 0) - writer.setOutlines(master); - // step 5: we close the document - document.close(); - } - catch(Exception e) { - e.printStackTrace(); - } - } - } -} -- cgit v1.2.3