Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem reading pdf with iText Library

 
Nicolas Stern
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have the follwing problem using iText.

I�m getting a byte array that is generated using a pdf generator library.

When I try to instanciate a PdfReader from this byte array, � java.io.IOException: Encrypted files are not supported � is thrown

When the same byte[] is viewed in Adobe Acrobat Reader (after having been sent to the browser with the according MIME type) and then saved physically, the file can be opened as argument to instanciate the pdfReader.

Looks like my byte array is recognized as an encrypted pdf.

The byte array is generated from a separate library from HTML.

What I don't get is why iText can open the file that has been created from the Byte array, but not the byte array itself.

Any hint ?

Thanks in advance
 
Nicolas Stern
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved.

I did not realize that the pdf generation process explicitely encrypted the file. All we had to do was to proceed to encryption later in the process.

Cheers - Nic
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic