[iText-questions] unable to compile itext source files

2007-07-16 Thread Milan Pandya

Hello,
I downloaded itext source files from the website. I extracted the files in
my home directory and it created a folder itext-src-2.0.4
I had to rename the folder to src.

After doing the above step, I ran successfully ant build.xml, and later on
ant compile and also ant jar
While doing ant compile and ant jar, I get more than 100 errors most of
them saying package does not exist. The error messages are long and hence I
am not posting it here.

Any idea where I am going wrong? without renaming folder
itext-src-1.0.04to src, also gives the same error.

Milan
-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] Populate forms that do not use Acro Fields

2007-07-16 Thread Michael Schierl
On Sat, 14 Jul 2007 15:35:56 -0500, scott carter wrote:

> I have a collection of forms that I need to automatically populate based on
> data in our database. 

Does it need to be a form afterwards or is it just for printing? In the
latter case, use a PdfStamper, get a PdfContentByte to lay over the page,
and add your texts on there (like it is done in the watermark example). You
will need a tool to get coordinates for that, GSView (from
http://www.cs.wisc.edu/~ghost/) does the job well for me (it shows
coordinates of the mouse pointer in the status bar).

Michael


-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] Problem while digitally sighning pdf using IText.

2007-07-16 Thread Michael Schierl
On Mon, 16 Jul 2007 05:05:08 -0700 (PDT), linkjaya wrote:

> Second by using tool given by acrobat professional.
>  when i use this key following key
>   Exception in thread "main" java.lang.NoClassDefFoundError:
> org/bouncycastle/asn1/DEREncodable

Add lib\bcprov-jdk14-135.jar (from SVN) to your runtime class path to avoid
this error.

HTH,

Michael


-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] Bookmark

2007-07-16 Thread Paulo Soares
It's done with PdfCopy.setOutlines().

Paulo 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Animesh Mondal
> Sent: Monday, July 16, 2007 12:49 PM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] Bookmark
> 
> Hi,
> I'm trying two concatenate some pdf files into a single file 
> and trying to create a bookmark to the section of 
> each(constituent) pdf's starting portion. The source pdfs 
> have no bookmark. I'm using PdfCopy writer object. I used 
> concat_pdf.java from iText tutorial. The files being 
> concatenated. but no bookmark. I've extended 
> PdfPageEventHelper class (as Bookmarks.java given in iText 
> bookmark tutorial), overriden onParagraph(), onEndPage() 
> methods and have called writer.setPageEvent() methods. But 
> all this not helping to create the bookmark. Here also i see 
> that I can't do any document.add() instead using writer.addPage().
> Please help.
> Thanks and regards, 
> Animesh.
> 
> 


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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] XFA PDF Document level javascript

2007-07-16 Thread Jon Radon

FYI - I was able to fix this by using the stamper.getWriter() function and
then using the returned writer to add an open action w/JavaScript.

On 7/11/07, Jon Radon <[EMAIL PROTECTED]> wrote:


Got it.  It seems like Adobe documented the change in 7.x and then
actually made the change in 8.x.

It's interesting though that the document level script runs just fine in a
standard PDF.  EX:  I created a simple PDF with no form elements, added the
javascript using PdfStamper, and it runs without the error.  However, all my
XFA PDFs give the NotAllowedError.  Any idea why the two give different
results?

Thanks,
Jon

On 7/11/07, Leonard Rosenthol <[EMAIL PROTECTED]> wrote:
>
> You are misunderstanding...
>
> The JavaScript that you are using is calling a method that is not
> permitted at startup time in a "non-trusted document".
>
> In order to have this script run, it either needs to do so in a
> trusted function (details in the Acrobat JavaScript reference) _OR_
> you need to certify your document
>
> Leonard
>
>
> On Jul 11, 2007, at 11:21 PM, Jon Radon wrote:
>
> > I thought so as well.  There is no security method set on the
> > document.  The security restrictions are set to "Not Allowed" for
> > the following items: Changing the Document, Document Assembly, and
> > Creation of Template Pages.
> >
> > If these restrictions are the problem, how do I go about removing
> > them?
> >
>
>
> -
> 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@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
>



--
Is it something someone said, was it something someone said?





--
Is it something someone said, was it something someone said?
-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


[iText-questions] Newbie help: adding "line" numbers

2007-07-16 Thread Richard Michael
Hello list,

I have just discovered iText, and have been reading the docs and
tutorials for an hour or so..

I'd like to add a column of numbers down the left margin of an existing
PDF, providing reference numbers for reviewers and editors who are
reading documents.

I'm looking for any general advice on implementation.

I guess I need to use a PdfReader to read the original, a PdfStamper to
add content to a duplicate document, and perhaps ColumnText to create a
rectangle positioned in the left margin and fill it with enough numbers,
each on a line, to cover the page from top to bottom.

Are there any suggestions to do this in a faster or easier way?

Thanks,
Richard

-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] Where to get Certificates for PDF Signing: PKCS11 works

2007-07-16 Thread Martin Brunecky

Well,
My other inquiries confirm that Adobe has made sure that their certificates
(I mean the ones rooted in Adobe CA) are truly "trusted" - level 2
certificates. Hence, in products with a broad population of signed/certified
document recipients, the VeriSign (formerly Geotrust) Adobe Certified
Document Services is probably the best source.

From: Harakiri <[EMAIL PROTECTED]> - 2007-07-03 01:43
>I dont believe another source exists - EVEN if it does
>exist Adobe has made it a rule that anyone issuing a
>certificate from their Adobe CA *must* be on a secure
>storage - so it will always be at least USB or Smart
>Card - no way to get in simply pkcs7 file format.
>
>I have the same problem and wondering if the USB token
>would be accessable through java or if it is only
>compatible with the adobe writer software
>

The good news is that iText and Sun PKCS#11 DOES DO work together, at least
for the Rainbow Technologies (now SafeNet) iKey 2032, used by GeoTrust (now
VeriSign) Adobe Certified Document Services (CDS).

The problem I see on this mailing list and WEB in general (and thru my own
pain and suffering) is that accessing USB tokens and/or smart cards via Sun
PKCS#11 implementation is very error prone: one minor mistake and you are in
the deep woods, and errors you are getting are just dragging you deeper (and
web searches make you believe that it can't work).

There are, however, several issues to be aware off (as of this writing: July
15 2007):

1) You _must_ supply iText interfaces not only with the private key and
certificate chain, but ALSO the "right" provider name (internally used to
create Signature object). Under Sun PKCS11, the provider name is
_dynamically_ generated, you MUST retrieve the provider name from the loaded
PKCS11 provider (see below); it is NOT "pkcs11".

2) For the iKey2032 you must use the "right" PKCS11 interface
implementation. I found that the obvious library
(c:\windows\system32\dkck232.dll) does not work, use the
c:\windows\system32\dkck201.dll. There may be even better-newer driver(s)
and DLL(s), but dkck201.dll works with JDK 1.5.0_03-b07 and later. See my
PKCS11 configuration file below.

3) The USB token (iKey 2032) provided by the Adobe CDS _only_ contains your,
leaf certificate. However, it is issued by "GeotTrust CA for Adobe", which
is then signed by "Adobe Root CA". If you sign using Acrobat, it will add
"GeoTrust CA for Adobe" to the certificate chain (from iKey) for you. If you
use iText as I do, I found that I have to add that certificate myself to the
"chain of 1" returned from the iKey (you can export it from Acrobat or get
it directly from GeoTrust). BEWARE that on the machine where you did the CDS
installation, Adobe products will find the GeoTrust certificate - but send
your PDF to some other machine, and "GeoTrust CA for Adobe" will be missing
- resulting in a signature that can not be validated. Note you do not add
"Adobe Root CA" - that one is installed in Adobe products. 
However, if you use iText to validate your signatures, you will need to make
sure that trusted keystore you use for verification contains the "Adobe Root
CA" (it is not present in the default, JRE provided trusted cacerts).

PKCS#11 Configuration file that works for me:

name = rainbow_token
library = c:\windows\system32\dkck201.dll
attributes = compatibility


To have a uniform way for passing around crypto parameters, I am using
several (PKCS7, JCE, PKCS11) implementations of the following interface:

package sign;
import java.security.PrivateKey;
import java.security.Provider;
import java.security.cert.Certificate;

public interface SignerKeystore {
public PrivateKey getPrivateKey() ;
public Certificate[] getChain() ;
public Provider getProvider();
}

The PKCS#11 implementation is a bit 'bulky', because it has to fetch the
'additional' certificate(s) used to complete the certification chain for
'my' certificate stored on the GeoTrust/VeriSign issued iKey 2032 (note
constructors use Streams so that I can embed data as Java class resources).

package sign;
import java.io.InputStream;
import java.security.*;
import java.security.cert.Certificate;
import java.util.Enumeration;
// import org.apache.commons.logging.Log;
// import org.apache.commons.logging.LogFactory;

public class SignerKeystorePKCS11 implements SignerKeystore {
// private final static Log log =
LogFactory.getLog(SignerKeystorePKCS11.class);
private static Provider prov = null;

private KeyStore ks;
private String   alias;
private String   pwd;

private PrivateKeykey;
private Certificate[] chain;

/**
* @param config - Sun PKCS#11 configuration file
* @param passw - PKCS#11 hardware token password
* @param addKs - Java JKS keystore containing additional signing
certificate(s)
*to add to the certificate chain returned from the
token.
*/
public SignerKeystorePKCS11(InputStream config, String passw,
InputStream addKs) thro

Re: [iText-questions] Itext font size vs Java swing font size

2007-07-16 Thread Bill Ensley
Java measures font in Pixels, iText measures them in Points

(pixel * .75) will give you the proper Point size. Ie:

34 * .75 = 25.5 points.

Conversely, Point / .75 will give you proper Pixel size.

These measurements are based on 96ppi which is not always the case, but it
is very common.

-Bill Ensley
www.bearprinting.com 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of david allen
> Sent: Sunday, July 15, 2007 8:07 PM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] Itext font size vs Java swing font size
> 
> 
> Hi all,
> I have a java swing applet that allows the user to enter some 
> text into a JTextArea object. This text is eventually used to 
> create a pdf file.
> However, in the JTextArea I have set the font size to 
> something quite large like 34 otherwise it is too small to 
> see in the JTextArea. If I use the same value for the font 
> size in IText I get a very , very large font. 
> 
> Does anyone know if the JTextArea uses a different system to 
> render the fonts to what Itext uses?
> 
> Thank you
> David
> --
> View this message in context: 
> http://www.nabble.com/Itext-font-size-vs-Java-swing-font-size-
> tf4084297.html#a11608569
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> 
> --
> ---
> 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@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/



-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] Populate forms that do not use Acro Fields

2007-07-16 Thread William Alexander Segraves
- Original Message -
From: "William Alexander Segraves" <[EMAIL PROTECTED]>
To: "Post all your questions about iText here"

Sent: Saturday, 14 July, 2007 5:33 PM
Subject: Re: [iText-questions] Populate forms that do not use Acro Fields


> - Original Message -
> From: "scott carter" <[EMAIL PROTECTED]>
> To: 
> Sent: Saturday, 14 July, 2007 3:35 PM
> Subject: [iText-questions] Populate forms that do not use Acro Fields
>
>
> > I have a collection of forms that I need to automatically populate based
> on
> > data in our database.  I have looked at the Register example on the
site,
> > and the example works great for forms that use Acro Fileds (
> > PdfStamper.getAcroFileds()).
>
> Yes, but the examples in the tutorial can only carry you so far. What you
> really, really need to do if you wish to work with iText is purchase a
copy
> of the book _iText in Action_ (see the "Buy the eBook" link at
> www.lowagie.com/iText).
>
> > I am running into several forms that do not
> > return any fields using this approach that I need to find a way to
> > populate.
>
> You should not expect to be able to populate fields that do not (yet)
exist.
> Burn this fact into your brain permanently. You'll be glad you did.
>
> > I am a beginner, so any help is greatly apprciated. One of the
> > forms that I need to figure out how to populate but does not have a Acro
> > fileds is found here ->
> > https://www.pfizerhelpfulanswers.com/files/C2C_English.pdf .   Anyone
know
> > how to do this?
> >
>
> Yes. There are several examples in the book (see Chapters 2 and 15) and on
> the book support site that will be helpful to you in your quest to convert
> PDF forms (unfillable) into AcroForms (fillable).
>
> > Thanks in advance.
> >
>
> You're very welcome! Reminders: (1) Buy the book. (2) You can't fill
fields
> that don't (yet) exist.

1. Have you bought the book?

2. To help you get started, you should look at the TextFields example in the
Tutorial. Using this example as a guide, you should be able to write a class
that will create all of the text fields that you need for your PDF form.

3. Now that you have an AcroForm (created in 2 above), you may wish to add
content to the form. See the example HelloWorldStamper in Chapter 2 of the
book for guidance on a way to add the C2C_English.pdf form as "under"
content, like a watermark, to your AcroForm (created in 2 above).

4. Now that you've generated an AcroForm that looks like your original
C2C_English.pdf form, you are ready to populate the fields. Remember: You
cannot fill (populate) fields that do not (yet) exist.

I hope this is helpful to you.

Cheers,
Bill Segraves


-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] Problem while digitally sighning pdf using IText.

2007-07-16 Thread linkjaya

Thanks for your prompt reply.

I created self signed digital id in two differnent ways 
First by using command line 
  keytool -genkey -keyalg RSA -alias jaya -keypass matrix -keystore
keystore.ks

when i use this key i got following exception
java.io.IOException: DerInputStream.getLength(): lengthTag=109, too big.

it also fails sighing in acrobat professional.

Second by using tool given by acrobat professional.
 when i use this key following key
Exception in thread "main" java.lang.NoClassDefFoundError:
org/bouncycastle/asn1/DEREncodable

i have downloaded latest version of itext from svn and compiled it.


Here is the code that i used to sign the PDF.

ks = KeyStore.getInstance("pkcs12");
ks.load(new FileInputStream("jaya.pfx"), "matrix321".toCharArray());
String alias = (String) ks.aliases().nextElement();
PrivateKey key = (PrivateKey) ks.getKey(alias, "matrix321".toCharArray());
Certificate[] chain = ks.getCertificateChain(alias);
PdfReader reader = new PdfReader("signature.pdf");
FileOutputStream fout = new FileOutputStream("signed.pdf");
PdfStamper stp = PdfStamper.createSignature(reader, fout, '\0');
PdfSignatureAppearance sap = stp.getSignatureAppearance();
sap.setCrypto(key, chain, null,
PdfSignatureAppearance.WINCER_SIGNED);
sap.setReason("I'm the author");
sap.setLocation("Kathmandu");
// comment next line to have an invisible signature
sap.setVisibleSignature(new Rectangle(100, 100, 200, 200), 1, null);
stp.close();

Please help me. where did i make mistake??


Regards
Jaya N Pasachhe



Paulo Soares wrote:
> 
> You'll be stuck forever if you don't provide more details.
> Where did you get the signature file from?
> Does it also fail if signing in Acrobat?
> What iText version are you using?
> What particular code are you using from
> http://itextpdf.sourceforge.net/howtosign.html?
> 
> Paulo
> 
> 
>> -Original Message-
>> From: [EMAIL PROTECTED] 
>> [mailto:[EMAIL PROTECTED] On 
>> Behalf Of linkjaya
>> Sent: Monday, July 16, 2007 9:58 AM
>> To: itext-questions@lists.sourceforge.net
>> Subject: [iText-questions] Problem while digitally sighning 
>> pdf using IText.
>> 
>> Hello all, I want to add a digital signature in pdf file 
>> containing singature field using Itext. i did as given in 
>> http://itextpdf.sourceforge.net/howtosign.html. but i always 
>> get following exception while loading the signature file. 
>> java.io.IOException: DerInputStream.getLength(): 
>> lengthTag=109, too big. can some one know, where is my 
>> problem? I am stuck over here. Any help will be appreciated. 
>> Regards Jaya N Pasachhe. 
> 
> 
> 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@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-while-digitally-sighning-pdf-using-IText.-tf4085267.html#a11613928
Sent from the iText - General mailing list archive at Nabble.com.
-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] Problem while digitally sighning pdf using IText.

2007-07-16 Thread Paulo Soares
If Acrobat can't sign using your file whay should iText be able to? 

Paulo

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of linkjaya
> Sent: Monday, July 16, 2007 1:05 PM
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] Problem while digitally 
> sighning pdf using IText.
> 
> Thanks for your prompt reply. I created self signed digital 
> id in two differnent ways First by using command line keytool 
> -genkey -keyalg RSA -alias jaya -keypass matrix -keystore 
> keystore.ks when i use this key i got following exception 
> java.io.IOException: DerInputStream.getLength(): 
> lengthTag=109, too big. it also fails sighing in acrobat 
> professional. Second by using tool given by acrobat 
> professional. when i use this key following key Exception in 
> thread "main" java.lang.NoClassDefFoundError: 
> org/bouncycastle/asn1/DEREncodable i have downloaded latest 
> version of itext from svn and compiled it. Here is the code 
> that i used to sign the PDF. ks = 
> KeyStore.getInstance("pkcs12"); ks.load(new 
> FileInputStream("jaya.pfx"), "matrix321".toCharArray()); 
> String alias = (String) ks.aliases().nextElement(); 
> PrivateKey key = (PrivateKey) ks.getKey(alias, 
> "matrix321".toCharArray()); Certificate[] chain = 
> ks.getCertificateChain(alias); PdfReader reader = new 
> PdfReader("signature.pdf"); FileOutputStream fout = new 
> FileOutputStream("signed.pdf"); PdfStamper stp = 
> PdfStamper.createSignature(reader, fout, '\0'); 
> PdfSignatureAppearance sap = stp.getSignatureAppearance(); 
> sap.setCrypto(key, chain, null, 
> PdfSignatureAppearance.WINCER_SIGNED); sap.setReason("I'm the 
> author"); sap.setLocation("Kathmandu"); // comment next line 
> to have an invisible signature sap.setVisibleSignature(new 
> Rectangle(100, 100, 200, 200), 1, null); stp.close(); Please 
> help me. where did i make mistake?? Regards Jaya N Pasachhe 
> 
>   Paulo Soares wrote:
>   You'll be stuck forever if you don't provide more 
> details. Where did you get the signature file from? Does it 
> also fail if signing in Acrobat? What iText version are you 
> using? What particular code are you using from 
> http://itextpdf.sourceforge.net/howtosign.html? Paulo > 
> -Original Message- > From: 
> [EMAIL PROTECTED] > 
> [mailto:[EMAIL PROTECTED] On > 
> Behalf Of linkjaya > Sent: Monday, July 16, 2007 9:58 AM > 
> To: itext-questions@lists.sourceforge.net > Subject: 
> [iText-questions] Problem while digitally sighning > pdf 
> using IText. > > Hello all, I want to add a digital signature 
> in pdf file > containing singature field using Itext. i did 
> as given in > http://itextpdf.sourceforge.net/howtosign.html. 
> but i always > get following exception while loading the 
> signature file. > java.io.IOException: 
> DerInputStream.getLength(): > lengthTag=109, too big. can 
> some one know, where is my > problem? I am stuck over here. 
> Any help will be appreciated. > Regards Jaya N Pasachhe. 


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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


[iText-questions] Fw: Bookmark

2007-07-16 Thread Animesh Mondal

- Original Message - 
From: Animesh Mondal 
To: [EMAIL PROTECTED] 
Sent: Monday, July 16, 2007 4:52 PM
Subject: Bookmark


Hi,
I'm trying two concatenate some pdf files into a single file and trying to 
create a bookmark to the section of each(constituent) pdf's starting portion. 
The source pdfs have no bookmark. I'm using PdfCopy writer object. I used 
concat_pdf.java from iText tutorial. The files being concatenated. but no 
bookmark. I've extended PdfPageEventHelper class (as Bookmarks.java given in 
iText bookmark tutorial), overriden onParagraph(), onEndPage() methods and have 
called writer.setPageEvent() methods. But all this not helping to create the 
bookmark. Here also i see that I can't do any document.add() instead using 
writer.addPage().

Please help.

Thanks and regards, 
Animesh.-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


[iText-questions] Bookmark

2007-07-16 Thread Animesh Mondal
Hi,
I\'m trying two concatenate some pdf files into a single file and trying to 
create a bookmark to the section of each(constituent) pdf\'s starting portion. 
The source pdfs have no bookmark. I\'m using PdfCopy writer object. I used 
concat_pdf.java from iText tutorial. The files being concatenated. but no 
bookmark. I\'ve extended PdfPageEventHelper class (as Bookmarks.java given in 
iText bookmark tutorial), overriden onParagraph(), onEndPage() methods and have 
called writer.setPageEvent() methods. But all this not helping to create the 
bookmark. Here also i see that I can\'t do any document.add() instead using 
writer.addPage().

Please help.

Thanks and regards, 
Animesh.-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


[iText-questions] How to use/install iTextSharp with C# Builder from Borland

2007-07-16 Thread ingo . schmoekel
Hi!

Reading my older questions you know that i'm not really familiar with java ;-)
I've decided trying iText with C#. Is there a guide anywhere online to see how 
to install iTextSharp in the C# Builder environment?

Thanks a lot for your help.

Best regards,
Ingo


--
This message was sent on behalf of [EMAIL PROTECTED] at openSubscriber.com
http://www.opensubscriber.com/messages/itext-questions@lists.sourceforge.net/topic.html

-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


[iText-questions] Crop to trim while merging - newbie

2007-07-16 Thread Marcello Oddini
Hello, I am merging a number of PDFs (the single pages of a magazine) into  
files of a fixed amount of pages to print them in booklet format with the 
following code

numBooklets48=numTotalPages/48;
for (int i=1;i<=numBooklets48;i++) {
strTemp = ("" + (1000+i)).substring(2);
//rectangle contains the right size;
  Document document = new Document(rectangle);
  PdfCopy copy = new PdfCopy(document, new FileOutputStream("Booklet"+i 
+ ".pdf"));
  document.open();
  for (int j=1;j<=48;j++){
 strTemp="page" +  j + 48*(i-1) + ".pdf";
 File f = new File(strTemp);
 if (f.exists()) {
 reader=new PdfReader(strTemp);
 copy.addPage(copy.getImportedPage(reader, 1));
}
 else {
 reader=new PdfReader("emptypage.pdf");
 copy.addPage(copy.getImportedPage(reader, 1));
  }
  }
   document.close();
}

This is working, but I would like 1) to be able to insert an empty page when 
the original page is missing. Now I am adding a page coming from an existing 
PDF. 2) I would like to crop the inserted pages to the trim box, while 
inserting them.

How could I do? Thanks in advance for any help.

Marcello




-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] GetImportedPage shrink problem

2007-07-16 Thread Paulo Soares
Depending on what you're trying to do it may be better to use
PdfStamper. In any case, the page has a crop box that must be taken into
account.

Paulo 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of [EMAIL PROTECTED]
> Sent: Sunday, July 15, 2007 10:41 PM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] GetImportedPage shrink problem
> 
> When I try and import the one page from the attached PDF 
> file, using the code below, the output PDF file has top and 
> bottom margins that do not match the input document.  Is 
> there anyway to get this to be an exact copy?  I want to copy 
> in the one page and then get the DirectContent and overlay.
>  
> Thanks in advance.
>  
> Here is the code:
>  
> import java.io.BufferedOutputStream;
> import java.io.FileNotFoundException;
> import java.io.FileOutputStream;
> import java.io.IOException;
> import java.net.URL;
>  
> import com.lowagie.text.Document;
> import com.lowagie.text.DocumentException;
> import com.lowagie.text.Rectangle;
> import com.lowagie.text.pdf.BaseFont;
> import com.lowagie.text.pdf.PdfContentByte;
> import com.lowagie.text.pdf.PdfCopy;
> import com.lowagie.text.pdf.PdfImportedPage;
> import com.lowagie.text.pdf.PdfReader;
> import com.lowagie.text.pdf.PdfWriter;
>  
> public class TestPDFForm
> {
>  private static final String INPUT_FORM = "TestInput.pdf";
>  
>  public TestPDFForm()
>  {
>  }
>  
>  public void createPDF() throws DocumentException, IOException
>  {
>   // Open the PDF file.
>   URL url = this.getClass().getClassLoader().getResource(INPUT_FORM);
>   PdfReader reader = new PdfReader(url);
>  
>   // Create a temporary file name.
>   String strTempPdfFileName = "c:/TestOutput.pdf";
>  
>   // Create the new file.
>   Rectangle psize = reader.getPageSize(1);
>   Document document = new Document(psize);
>   BufferedOutputStream bos =
>new BufferedOutputStream(new FileOutputStream(strTempPdfFileName));
>   PdfWriter writer = PdfWriter.getInstance(document, bos);
>   writer.setViewerPreferences(PdfWriter.PrintScalingNone);
>   document.open();
>  
>   // Copy the pages to the new file.
>   PdfContentByte cb = writer.getDirectContent();
>  
>   for (int i = 1; i <=reader.getNumberOfPages(); i++)
>   {
>document.newPage();
>PdfImportedPage page = writer.getImportedPage(reader, i);
>cb.addTemplate(page, 0, 0);
>   }
>   
>   document.close();
>   writer.close();
>   bos.close();
>  }
>  
>  public static void main(String args[])
>  {
>   try
>   {
>TestPDFForm form = new TestPDFForm();
>form.createPDF();
>System.out.println("Done...");
>System.exit(0);
>   }
>   catch( Throwable t)
>   {
>t.printStackTrace();
>System.exit(1);
>   }
>  }
>  
> }


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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] Problem while digitally sighning pdf using IText.

2007-07-16 Thread Paulo Soares
You'll be stuck forever if you don't provide more details.
Where did you get the signature file from?
Does it also fail if signing in Acrobat?
What iText version are you using?
What particular code are you using from
http://itextpdf.sourceforge.net/howtosign.html?

Paulo


> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of linkjaya
> Sent: Monday, July 16, 2007 9:58 AM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] Problem while digitally sighning 
> pdf using IText.
> 
> Hello all, I want to add a digital signature in pdf file 
> containing singature field using Itext. i did as given in 
> http://itextpdf.sourceforge.net/howtosign.html. but i always 
> get following exception while loading the signature file. 
> java.io.IOException: DerInputStream.getLength(): 
> lengthTag=109, too big. can some one know, where is my 
> problem? I am stuck over here. Any help will be appreciated. 
> Regards Jaya N Pasachhe. 


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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


[iText-questions] Problem while digitally sighning pdf using IText.

2007-07-16 Thread linkjaya

Hello all,

I want to add a digital signature in pdf file containing singature field
using Itext. i did as given in
http://itextpdf.sourceforge.net/howtosign.html.
but i always get following exception while loading the signature file.
   java.io.IOException: DerInputStream.getLength(): lengthTag=109, too big.

can some one know, where is my problem?
I am stuck over here.
Any help will  be appreciated.

Regards
Jaya N Pasachhe.



-- 
View this message in context: 
http://www.nabble.com/Problem-while-digitally-sighning-pdf-using-IText.-tf4085267.html#a11611359
Sent from the iText - General mailing list archive at Nabble.com.
-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


[iText-questions] Itext font size vs Java swing font size

2007-07-16 Thread david allen

Hi all,
I have a java swing applet that allows the user to enter some text into a
JTextArea object. This text is eventually used to create a pdf file.
However, in the JTextArea I have set the font size to something quite large
like 34 otherwise it is too small to see in the JTextArea. If I use the same
value for the font size in IText I get a very , very large font. 

Does anyone know if the JTextArea uses a different system to render the
fonts to what Itext uses?

Thank you
David
-- 
View this message in context: 
http://www.nabble.com/Itext-font-size-vs-Java-swing-font-size-tf4084297.html#a11608569
Sent from the iText - General mailing list archive at Nabble.com.


-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] tables text and margin

2007-07-16 Thread Bruno Lowagie

Corwin noname wrote:
How to get highest character to touch the top border of the cell? Is it 
possible to do that?


I just checked the book and it should be setUseAscender instead
of setAscender. I hope you already found this out yourself.
In any case: reading chapter 6 of the book would have saved
you from having to ask the question. What surprised me reading
your question was that you found setUseDescender, but failed
to find setUseAscender...

Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream("cellheight.pdf"));
document.open();
PdfPTable myTable = new PdfPTable(1);
PdfPCell cell = new PdfPCell();
cell.addElement(new Chunk("abcdefghijklmnopqrstuvwxuz"));
cell.setPadding(0);
cell.setUseAscender(true);
cell.setUseDescender(true);
myTable.addCell(cell);
document.add(myTable);
document.close();

br,
Bruno


cellheight.pdf
Description: Adobe PDF document
-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] tables text and margin

2007-07-16 Thread Bruno Lowagie
Corwin noname wrote:
> How to get highest character to touch the top border of the cell? Is it 
> possible to do that?

I assume you have used setDescender(true);
(although you didn't say anything about the solution you
were using), but did you setAscender(true);
And what about the leading of the cell?
Did you take that into account?

What I meant with my counter-question was:
the information you are giving us is very vague.
That makes it almost impossible for us to answer
the question.

br,
Bruno

-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


Re: [iText-questions] Reorder existing Document

2007-07-16 Thread Bruno Lowagie
Hubert Zwick wrote:
> Hello!
> 
> How can i reorder a existing Document?
> The way "stamper.getWriter().reorderPages(order);" don't work!

Of course not, that's for newly created documents.

> is there a way to reorder a existing document?

I'd use PdfReader, selectPages() and PdfStamper.
There's an example in the iText toolbox,
and selectPages() is explained in chapter 2 of the book.
br,
Bruno

-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/