Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

Re: [iText-questions] java.io.IOException while decrypting
 largepdf-documents

Paulo Soares

2007-07-10

Replies:

Document.plainRandomAccess = true;

Paulo

> -----Original Message-----
> From: itext-questions-bounces@(protected)
> [mailto:itext-questions-bounces@(protected)
> Behalf Of ingo.schmoekel@(protected)
> Sent: Tuesday, July 10, 2007 3:31 PM
> To: itext-questions@(protected)
> Subject: [iText-questions] java.io.IOException while
> decrypting largepdf-documents
>
> Hello!
>
> Me again ;-)
> I'm using a part from your example for decryption:
>
> // . . .
> try
> {
> System.out.println("Reading " + args[INPUT_FILE]);
> PdfReader reader = new PdfReader(args[INPUT_FILE],
> args[OWNER_PASSWORD].getBytes());
> System.out.println("Writing " + args[OUTPUT_FILE]);
> PdfStamper stamper = new PdfStamper(reader, new
> FileOutputStream(args[OUTPUT_FILE]));
> stamper.close();  
> System.out.println("Done.");
> return;
> }
> catch (Exception e)
> {
> e.printStackTrace();
> return;
> }
> // . . .
>
> Decrypting "normal" documents works fine but i've two samples
> (1.9 mb and over 1000 pages / 13 mb and over 800 pages). When
> i want to decrypt these files i always get an io-error like this:
> java.io.IOException
>   at gnu.java.nio.channels.FileChannelImpl.mapImpl(...)
>   at com.lowagie.text.pdf.MappedRandomAccessFile.<init>(...)
>   at com.lowagie.text.pdf.PdfReader.getStreamBytesRaw(...)
>
> The resulting files are not complete and unreadable.
> Can you imagine where my problem is (one is my bad java-knowledge ;-)
> Thanks a lot in advance.
>
> Best regards,
> Ingo


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
©2008 junlu.com - Jax Systems, LLC, U.S.A.