Hi manoj kumar,
I am Prasad, in response to your question that is to make pdf not
copyable,Here is a solution for that
Document document = new Document(PageSize.A4, 20, 20, 20, 20);
PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream("d:\\test\\pdfopen.pdf"));
writer.setEncryption(null,null,
PdfWriter.ALLOW_PRINTING,PdfWriter.STANDARD_ENCRYPTION_128);-->this line is
important
writer.createXmpMetadata();
and to run dis code additional jars will be required im attaching those too.
All the jars may not be important..try once
Please let me know if you successfully execute it.
Regards,
Prasad,
Infotech Enterprises Ltd,
Hyderabad.
-----Original Message-----
From: [email protected]
[mailto:[email protected]]
Sent: Monday, January 30, 2012 3:44 PM
To: [email protected]
Subject: iText-questions Digest, Vol 68, Issue 84
Send iText-questions mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/itext-questions
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of iText-questions digest..."
Today's Topics:
1. Re: SunPKC11 Exception when signing PDF (Andreas Kuehne)
2. Re: To make pdf not copyable (Alexis Pigeon)
3. Re: iText-questions Digest, Vol 68, Issue 83, Response to
manoj kumar (Prasad Chadaram)
----------------------------------------------------------------------
Message: 1
Date: Mon, 30 Jan 2012 09:21:07 +0100
From: Andreas Kuehne <[email protected]>
Subject: Re: [iText-questions] SunPKC11 Exception when signing PDF
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hi Valentin,
my first remark is that iText is far away from PKCS11 session. The sun
jac/plkcs11 bridge is obviously managing the sessions as you can see
from the call stack.
Second remark: where is iText involved at all? Looks like you using a
'btrust' signer.Maybe you're better off at that mailing list ;-)
Greetings
Andreas
> Hello,
>
> when i sign hundreds of PDF files i got this exception :
>
>
> * java.security.ProviderException: Initialization failed
> * at
> sun.security.pkcs11.P11Signature.initialize(P11Signature.java:294)
> * at
> sun.security.pkcs11.P11Signature.engineInitSign(P11Signature.java:375)
> * at java.security.Signature$Delegate.engineInitSign(Unknown
> Source)
> * at java.security.Signature.initSign(Unknown Source)
> * at org.btrust.signer.PDFSigner.initSignPDF(PDFSigner.java:298)
> * at org.btrust.signer.PDFSigner.signPDF(PDFSigner.java:484)
> * at org.btrust.util.SignThread.run(SignThread.java:646)
> * Caused by: sun.security.pkcs11.wrapper.PKCS11Exception:
> CKR_SESSION_COUNT
> * at sun.security.pkcs11.wrapper.PKCS11.C_OpenSession(Native
> Method)
> * at
> sun.security.pkcs11.SessionManager.openSession(SessionManager.java:185)
> * at
> sun.security.pkcs11.SessionManager.getOpSession(SessionManager.java:123)
> * at sun.security.pkcs11.Token.getOpSession(Token.java:247)
> * at
> sun.security.pkcs11.P11Signature.initialize(P11Signature.java:283)
> * ... 6 more
> I think that some of the iText classes are messing with the provider like
> creating/removing sessions. But i can not figure out if this is true.
> I though it might be Provider problem and i wrote to them, but they ensure me
> the problem is not at the provider .dll file.
>
> If I get the private Key and use it to sign many files i got this exception:
>
> java.security.ProviderException: Could not obtain session
> at
> sun.security.pkcs11.SessionManager.getOpSession(SessionManager.java:130)
> at sun.security.pkcs11.Token.getOpSession(Token.java:247)
> at sun.security.pkcs11.P11Signature.initialize(P11Signature.java:283)
> at sun.security.pkcs11.P11Signature.engineInitSign(P11Signature.java:375)
> at java.security.Signature$Delegate.engineInitSign(Unknown Source)
> at java.security.Signature.initSign(Unknown Source)
> at org.btrust.signer.PDFSigner.initSignPDF(PDFSigner.java:299)
> at org.btrust.signer.PDFSigner.signPDF(PDFSigner.java:486)
> at org.btrust.util.SignThread.run(SignThread.java:664)
>
> The exception is thrown at line : "Signature.initSign(PrivateKey);"And this
> happens at file 100 all the time. Does someone know why?
>
>
> If I create new Provider every 90 files i get the first exception i posted.
> The strange is that i get the exception at different file every time, but
> after file 100.
>
> Seems like some classes are playing with the provider sessions!!!
>
>
>
> M. Cp. Eng. Valentin Ivanov
>
>
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
>
>
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
--
Andreas K?hne
phone: +49 177 293 24 97
mailto: [email protected]
Trustable Ltd. Niederlassung Deutschland Str?verstr. 18 - 59427 Unna
Amtsgericht Hamm HRB 5868
Directors Andreas K?hne, Heiko Veit
Company UK Company No: 5218868 Registered in England and Wales
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
Message: 2
Date: Mon, 30 Jan 2012 10:06:52 +0100
From: Alexis Pigeon <[email protected]>
Subject: Re: [iText-questions] To make pdf not copyable
To: Post all your questions about iText here
<[email protected]>
Message-ID:
<cah8rlpf543ay9d373ipw0rxz6uucw1lyk3ihlplbi+qzlqb...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi manoj,
On 30 January 2012 08:16, manoj kumar <[email protected]> wrote:
> I am trying to make a pdf whose content cant be copied.i.e copy
> restricted pdf. is this possible??
>
Have a look at the PdfWriter.setEncryption() method
<
http://api.itextpdf.com/itext/com/itextpdf/text/pdf/PdfWriter.html#setEncryption%28byte[],%20byte[],%20int,%20int%29>
[ Note to iText committers :
The Javadoc is wrong here, the permissions should be uppercase and
_separated, since the camelCase permissions have been deprecated. Would be
nice to have these corrected.
I'll try to submit a patch for that today. ]
HTH,
alexis
> pls help me.
>
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
>
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
Message: 3
Date: Mon, 30 Jan 2012 10:08:44 +0000
From: Prasad Chadaram <[email protected]>
Subject: Re: [iText-questions] iText-questions Digest, Vol 68, Issue
83, Response to manoj kumar
To: "[email protected]"
<[email protected]>
Message-ID:
<68cf956831101e4e9e8d9df9cdfede1a056...@infhydex10mb2.corp.infotech-enterprises.com>
Content-Type: text/plain; charset="us-ascii"
Hi manoj kumar,
I am Prasad, in response to your question that is to make pdf not
copyable,Here is a solution for that
Document document = new Document(PageSize.A4, 20, 20, 20, 20);
PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream("d:\\test\\pdfopen.pdf"));
writer.setEncryption(null,null,
PdfWriter.ALLOW_PRINTING,PdfWriter.STANDARD_ENCRYPTION_128);-->this line is
important
writer.createXmpMetadata();
and to run dis code additional jars will be required im attaching those too.
All the jars may not be important..try once
Please let me know if you successfully execute it.
Regards,
Prasad,
Infotech Enterprises Ltd,
Hyderabad.
-----Original Message-----
From: [email protected]
[mailto:[email protected]]
Sent: Monday, January 30, 2012 1:25 PM
To: [email protected]
Subject: iText-questions Digest, Vol 68, Issue 83
Send iText-questions mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/itext-questions
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of iText-questions digest..."
Today's Topics:
1. Re: jpanel to itext pdf (Bill Ensley)
2. To make pdf not copyable (manoj kumar)
3. SunPKC11 Exception when signing PDF (Valentin Ivanov)
----------------------------------------------------------------------
Message: 1
Date: Sun, 29 Jan 2012 20:22:24 -0800
From: Bill Ensley <[email protected]>
Subject: Re: [iText-questions] jpanel to itext pdf
To: Post all your questions about iText here
<[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
I'm not sure I understand your question, so I'll ask my own.
Do you want to draw the contents of a JPanel into a PDF?
If so, all you need is to pass a PDFGraphics2D object from the
appropriate page into your JPanel
and then ask the JPanel to paint itself.
If you are asking if iText can reformat your JPanel content to fit a
certain page, then the answer is no.
It will have to work the other way around, you will have to format your
JPanel to fit the PDF page you
are painting into.
-Bill Ensley
www.bearprinting.com
On 1/29/2012 8:18 PM, bijal vadher wrote:
> I know you are talking about the scaling and transformation
> matrix....but only that doesnt solve my problem .I also need some
> control which can make it possible to move from one page to other...i
> can specify the page number it has to go to that particular page and
> write there...is that possible through itext.pls reply asap.Its very
> imp for me to deal this asap.
>
> On Mon, Jan 30, 2012 at 1:23 AM, Bill Ensley <[email protected]
> <mailto:[email protected]>> wrote:
>
> There is a section of the iText in Action book that covers this
> question
> in detail.
>
> There are also many examples in the iText archives related to this.
>
> I tell you this to teach you to fish instead of providing your
> meal for you.
>
> -Bill Ensley
> www.bearprinting.com <http://www.bearprinting.com>
>
> On 1/29/2012 12:33 AM, bijalvadher wrote:
> > I have a jpanel of size 2326*750 and need to put its contents
> into pdf where
> > in page size is a4.The fields in jpanel are not added in
> sequence so fields
> > from any position can come and i need to create its correponding
> part in pdf
> > with proportionate size and position
> > the look and feel shold be same
> > only size should be reduced when placed in pdf
> >
> >
> > --
> > View this message in context:
>
> http://itext-general.2136553.n4.nabble.com/jpanel-to-itext-pdf-tp4337819p4337819.html
> > Sent from the iText - General mailing list archive at Nabble.com.
> >
> >
>
> ------------------------------------------------------------------------------
> > Try before you buy = See our experts in action!
> > The most comprehensive online learning library for Microsoft
> developers
> > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5,
> CSS3, MVC3,
> > Metro Style Apps, more. Free future releases when you subscribe now!
> > http://p.sf.net/sfu/learndevnow-dev2
> > _______________________________________________
> > iText-questions mailing list
> > [email protected]
> <mailto:[email protected]>
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
> > iText(R) is a registered trademark of 1T3XT BVBA.
> > Many questions posted to this list can (and will) be answered
> with a reference to the iText book: http://www.itextpdf.com/book/
> > Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
>
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft
> developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3,
> MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> iText-questions mailing list
> [email protected]
> <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered with
> a reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
>
>
>
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
>
>
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
Message: 2
Date: Mon, 30 Jan 2012 12:46:48 +0530
From: manoj kumar <[email protected]>
Subject: [iText-questions] To make pdf not copyable
To: [email protected]
Message-ID:
<CA+=Y_LeAbx05JddssHr4ttx0FaTxx2O_M=wjppdyxrwuvqd...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
I am trying to make a pdf whose content cant be copied.i.e copy
restricted pdf. is this possible??
pls help me.
------------------------------
Message: 3
Date: Sun, 29 Jan 2012 23:54:38 -0800 (PST)
From: Valentin Ivanov <[email protected]>
Subject: [iText-questions] SunPKC11 Exception when signing PDF
To: "[email protected]"
<[email protected]>
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hello,
when i sign hundreds of PDF files i got this exception :
* java.security.ProviderException:?Initialization?failed??
*
????at?sun.security.pkcs11.P11Signature.initialize(P11Signature.java:294)??
*
????at?sun.security.pkcs11.P11Signature.engineInitSign(P11Signature.java:375)??
*
????at?java.security.Signature$Delegate.engineInitSign(Unknown?Source)??
* ????at?java.security.Signature.initSign(Unknown?Source)??
* ????at?org.btrust.signer.PDFSigner.initSignPDF(PDFSigner.java:298)??
* ????at?org.btrust.signer.PDFSigner.signPDF(PDFSigner.java:484)??
* ????at?org.btrust.util.SignThread.run(SignThread.java:646)??
*
Caused?by:?sun.security.pkcs11.wrapper.PKCS11Exception:?CKR_SESSION_COUNT??
*
????at?sun.security.pkcs11.wrapper.PKCS11.C_OpenSession(Native?Method)??
*
????at?sun.security.pkcs11.SessionManager.openSession(SessionManager.java:185)??
*
????at?sun.security.pkcs11.SessionManager.getOpSession(SessionManager.java:123)??
* ????at?sun.security.pkcs11.Token.getOpSession(Token.java:247)??
*
????at?sun.security.pkcs11.P11Signature.initialize(P11Signature.java:283)??
* ????...?6?more
I think that some of the iText classes are messing with the provider like
creating/removing sessions. But i can not figure out if this is true.
I though it might be Provider problem and i wrote to them, but they ensure me
the problem is not at the provider .dll file.
If I get the private Key and use it to sign many files i got this exception:
java.security.ProviderException: Could not obtain session
??? at sun.security.pkcs11.SessionManager.getOpSession(SessionManager.java:130)
??? at sun.security.pkcs11.Token.getOpSession(Token.java:247)
??? at sun.security.pkcs11.P11Signature.initialize(P11Signature.java:283)
??? at sun.security.pkcs11.P11Signature.engineInitSign(P11Signature.java:375)
??? at java.security.Signature$Delegate.engineInitSign(Unknown Source)
??? at java.security.Signature.initSign(Unknown Source)
??? at org.btrust.signer.PDFSigner.initSignPDF(PDFSigner.java:299)
??? at org.btrust.signer.PDFSigner.signPDF(PDFSigner.java:486)
??? at org.btrust.util.SignThread.run(SignThread.java:664)
The exception is thrown at line : "Signature.initSign(PrivateKey);"And this
happens at file 100 all the time. Does someone know why?
If I create new Provider every 90 files i get the first exception i posted.
The strange is that i get the exception at different file every time, but after
file 100.?
Seems like some classes are playing with the provider sessions!!!
?
M. Cp. Eng. Valentin Ivanov
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA
End of iText-questions Digest, Vol 68, Issue 83
***********************************************
________________________________
DISCLAIMER:
This email may contain confidential information and is intended only for the
use of the specific individual(s) to which it is addressed. If you are not the
intended recipient of this email, you are hereby notified that any unauthorized
use, dissemination or copying of this email or the information contained in it
or attached to it is strictly prohibited. If you received this message in
error, please immediately notify the sender at Infotech or
[email protected] and delete the original message.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bcmail-jdk15-146.jar
Type: application/java-archive
Size: 487135 bytes
Desc: bcmail-jdk15-146.jar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bcpg-jdk15-146.jar
Type: application/java-archive
Size: 165617 bytes
Desc: bcpg-jdk15-146.jar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bcprov-ext-jdk15-146.jar
Type: application/java-archive
Size: 1825962 bytes
Desc: bcprov-ext-jdk15-146.jar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bcprov-jdk15-146.jar
Type: application/java-archive
Size: 1815677 bytes
Desc: bcprov-jdk15-146.jar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bctest-jdk15-146.jar
Type: application/java-archive
Size: 1983801 bytes
Desc: bctest-jdk15-146.jar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bctsp-jdk15-146.jar
Type: application/java-archive
Size: 39707 bytes
Desc: bctsp-jdk15-146.jar
------------------------------
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA
End of iText-questions Digest, Vol 68, Issue 84
***********************************************
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php