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!
MBPSplitter.java
Description: MBPSplitter.java
