Sorin Marti wrote:
> Hi all,
> 
> I am a bit confused about the following error:
> 
> Exception occurred during event dispatching:
> java.lang.IllegalArgumentException: PdfReader not opened with owner password
>       at com.lowagie.text.pdf.PdfReaderInstance.getImportedPage(Unknown 
> Source)
>       at com.lowagie.text.pdf.PdfCopy.getImportedPage(Unknown Source)

Your PDF was encrypted and you didn't provide the owner password.
Provide the owner password and the error will disappear.

> - Suddendly had an error like: java.lang.NoClassDefFoundError:
> org/bouncycastle/asn1/ASN1OctetString

You must have been using a very, very old iText version.
See http://1t3xt.be/?Z000403 and look at the Technical Requirements.
See http://1t3xt.be/?Z000439 to know where to find the BC jare:
http://itext.svn.sourceforge.net/viewvc/itext/trunk/lib/

> - Searched the web, found a link of Bruno:
> http://sourceforge.net/project/showfiles.php?group_id=15255&package_id=151860
> - Downloaded ALL of the packages and searched them: no bouncycastle
> package was there...

Those are libraries used in the tutorial examples.

> - Searched for the package, found it at:
> www.mvnrepository.com/artifact/bouncycastle/bcprov-jdk14/
> - Included it and now I have the new error:
> java.lang.IllegalArgumentException: PdfReader not opened with owner
> password
> - Searched the web again, found FAQ-Entry:
> http://1t3xt.info/tutorials/faq.php?branch=faq.itext&node=password

Correct. There was a flaw in earlier iText versions.

> I created the PDF which I like to include and I did it by saving an
> old MS-Word document with a PDF-Printer. I did not use a password for
> sure.
> 
> - What can I do to avoid this error or where/how do I supply a password?

I know the answer, but I can't provide it.

> - If I don't know the password, what opportunities do I have

Legally, you can't do anything.

> - Can't I just simply ignore the pw?

No; but if you think hard enough,
you'll find out you already have the answer.
(I know because I can read the answer implicitly
in your question.)

> - Can I check if a pdf has a protection.

Yes: reader.isEncrypted();

> - Where to read more about this?

In the PDF reference manual.
br,
Bruno

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to