Thanks Paulo! I made assumptions about JVM memory size that were not correct. I have it working now.
Earnie! -----Original Message----- From: Paulo Soares [mailto:[EMAIL PROTECTED] Sent: Monday, November 07, 2005 6:03 PM To: Earnie Dyke; [email protected] Subject: Re: [iText-questions] Problem reading really large PDF files How much memory do you have in the JVM? ----- Original Message ----- From: "Earnie Dyke" <[EMAIL PROTECTED]> To: "Paulo Soares" <[EMAIL PROTECTED]>; <[email protected]> Sent: Monday, November 07, 2005 10:02 PM Subject: RE: [iText-questions] Problem reading really large PDF files OK. I found it in the 1.3.5 version. I am, however, still getting an OutOfMemory exception when I try to read a 39 meg pdf. I am running on a Windows 2000 machine with 512 meg of ram. Any ideas? See code below. Earnie! package com.vrs.selfserv.util; import java.io.*; import java.net.URL; import com.lowagie.text.*; import com.lowagie.text.pdf.*; public class MBPSplitter { public MBPSplitter() { } /** * @param args */ public static void main(String[] args) { System.out.println("Here we go..."); try { byte pswd[] = null; URL inputFile = new URL("file://xyz/xyz/xyz.pdf"); RandomAccessFileOrArray accessor = new RandomAccessFileOrArray(inputFile); PdfReader reader = new PdfReader(accessor,null); System.out.println("File size: " + reader.getFileLength()); Document document = new Document(reader.getPageSizeWithRotation(1)); PdfCopy copy = new PdfCopy(document, new FileOutputStream("c:\\xyz\\xyz.pdf")); document.open(); PdfImportedPage page = copy.getImportedPage(reader, 3); System.out.println("page number: " + page.getPageNumber()); copy.addPage(page); document.close(); // copy.close(); } catch (RuntimeException e) { System.out.println("Runtime Exception: " + e.getMessage()); e.printStackTrace(); } catch (Exception e) { System.out.println("Exception: " + e.getMessage()); e.printStackTrace(); } finally { System.out.println("done..."); } } } -----Original Message----- From: Paulo Soares [mailto:[EMAIL PROTECTED] Sent: Monday, November 07, 2005 4:44 PM To: Earnie Dyke; [email protected] Subject: Re: [iText-questions] Problem reading really large PDF files It's there. ----- Original Message ----- From: "Earnie Dyke" <[EMAIL PROTECTED]> To: "Paulo Soares" <[EMAIL PROTECTED]>; <[email protected]> Sent: Monday, November 07, 2005 9:40 PM Subject: RE: [iText-questions] Problem reading really large PDF files Which version is this in? I have installed version 1.3 but I do not see this constructor. Earnie! ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
