Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

Re: [iText-questions] PdfImportedPage from byte array?

Paulo Soares

2006-08-31

Replies:

Where's copy.open()?

Paulo

----- Original Message -----
From: <bgiles@(protected)>
To: <iText-questions@(protected)>
Cc: <bgiles@(protected)>
Sent: Thursday, August 31, 2006 4:16 PM
Subject: [iText-questions] PdfImportedPage from byte array?


> I'm getting a Document exception on
>
>     byte[] data = PDF document loaded from cache
>
>     ByteArrayOutputStream os = new ByteArrayOutputStream();
>     Document document = new Document(PageSize.LETTER);
>     PdfCopy copy = new PdfCopy(document, os);
>     PdfReader r = new PdfReader(data);
>
>     for (int i = 1; i <= r.getNumberOfPages(); i++) {
>        PdfImportedPage page = copy.getImportedPage(r, i); // throws up
>        copy.addPage(page);
>     }
>
> I know that data[] is okay since I can write it back out to a file and
> view it with Acrobat.
>
> I'm fairly sure that this code was working in 1.3 (or 1.3.1?), but it's
> barfing on 1.4.2. I think I also tried it with 1.4.4, but with Websphere
> who can ever really be certain of anything? :-)
>
> Any pointers?
>
> BTW the website at Univ. of Ghent looks good, but I didn't notice a
> 'download' link.
>
> Bear
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> iText-questions mailing list
> iText-questions@(protected)
> https://lists.sourceforge.net/lists/listinfo/itext-questions


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.