Re: [iText-questions] ArrayIndexOutOfBoundsException with tiff file

2011-10-22 Thread Müller-Tolk, Jörg
On 20/10/11 23:14, zx5000 wrote:

>>I am getting the exception while reading a tiff using the
>>TiffImage.getTiffImage method (in code below). If I step through the code in
>>the debugger (netbeans) I cannot duplicate the failure.
>>
>>Is this a timing issue? Should I slow the execution down?
>>
>>TIA
>>
>>
In case the Tiff was recorded as a received fax image - the reason could 
be an incomplete last pixel line.

--
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
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


Re: [iText-questions] ArrayIndexOutOfBoundsException with tiff file

2011-10-21 Thread Balder VC
There is no code below ...

On 20/10/11 23:14, zx5000 wrote:
> I am getting the exception while reading a tiff using the
> TiffImage.getTiffImage method (in code below). If I step through the code in
> the debugger (netbeans) I cannot duplicate the failure.
> 
> Is this a timing issue? Should I slow the execution down?
> 
> TIA
> 
> 
> 
> --
> View this message in context: 
> http://itext-general.2136553.n4.nabble.com/ArrayIndexOutOfBoundsException-with-tiff-file-tp3923442p3923442.html
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> --
> The demand for IT networking professionals continues to grow, and the
> demand for specialized networking skills is growing even more rapidly.
> Take a complimentary Learning@Cisco Self-Assessment and learn 
> about Cisco certifications, training, and career opportunities. 
> http://p.sf.net/sfu/cisco-dev2dev
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> 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

-- 
Balder VC
http://www.redlab.be/blog/
http://twitter.com/redlabbe

--
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
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


[iText-questions] ArrayIndexOutOfBoundsException with tiff file

2011-10-20 Thread zx5000
I am getting the exception while reading a tiff using the
TiffImage.getTiffImage method (in code below). If I step through the code in
the debugger (netbeans) I cannot duplicate the failure.

Is this a timing issue? Should I slow the execution down?

TIA



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/ArrayIndexOutOfBoundsException-with-tiff-file-tp3923442p3923442.html
Sent from the iText - General mailing list archive at Nabble.com.

--
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
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


Re: [iText-questions] ArrayIndexOutOfBoundsException while encrypting a PDF with AES 256 (IText pdf java)

2011-06-22 Thread Paulo Soares
Certificate encryption for AES 256 is not yet supported. It should be available 
in September.

Paulo 

-Original Message-
From: Alex Miller [mailto:reisnakea...@gmail.com] 
Sent: Wednesday, June 22, 2011 2:48 PM
To: itext-questions@lists.sourceforge.net
Subject: [iText-questions] ArrayIndexOutOfBoundsException while encrypting a 
PDF with AES 256 (IText pdf java)

Hi,

When I try to encrypt a pdf using AES 256 it gives me the following error:

java.lang.ArrayIndexOutOfBoundsException
 at java.lang.System.arraycopy(Native Method)
 at 
com.itextpdf.text.pdf.PdfEncryption.setupByEncryptionKey(PdfEncryption.java:527)
 at 
com.itextpdf.text.pdf.PdfEncryption.getEncryptionDictionary(PdfEncryption.java:633)
 at com.itextpdf.text.pdf.PdfWriter.setEncryption(PdfWriter.java:2057)
 at com.itextpdf.text.pdf.PdfStamper.setEncryption(PdfStamper.java:349)


This is the code that generates the error:

public static KeyPair generateKeyPair(String algorithm, int bitLength) 
throws NoSuchAlgorithmException {
 KeyPairGenerator kpGen = null;

 try {
 kpGen = KeyPairGenerator.getInstance(algorithm, "BC");
 } catch (NoSuchProviderException ex) {
 Logger.getLogger(Util.class.getName()).log(Level.SEVERE, 
null, ex);
 }
 kpGen.initialize(bitLength, new SecureRandom());

 return kpGen.generateKeyPair();
 }

public static Certificate getCertificate(KeyPair pair) throws Exception {
 X509v3CertificateBuilder builder = new 
X509v3CertificateBuilder(new X500Name("CN=CA"),
 BigInteger.valueOf(new Date().getTime()),
 new Date(),
 new Date(new Date().getTime() + 1L),
 new X500Name("CN=Reader"),
 
SubjectPublicKeyInfo.getInstance(pair.getPublic().getEncoded()));
 ContentSigner signer = new 
JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(pair.getPrivate());
 X509CertificateHolder certHolder = builder.build(signer);
 ByteArrayInputStream bIn = new 
ByteArrayInputStream(certHolder.getEncoded());
 return CertificateFactory.getInstance("X.509", 
"BC").generateCertificate(bIn);
 }

public static void encryptPdf(String src, String dest, Certificate 
readCertificate)
 throws IOException, DocumentException, CertificateException {
 PdfReader reader = new PdfReader(src);
 FileOutputStream fout = new FileOutputStream(dest);
 PdfStamper stamper = new PdfStamper(reader, fout);
 stamper.setEncryption(new Certificate[]{readCertificate},  // 
This is the instruction that gives me the error!
 new int[]{PdfWriter.ALLOW_PRINTING},
 //
 PdfWriter.ENCRYPTION_AES_256);
 //
 stamper.close();
 fout.close();
 }

public static final String ORIGINAL = "./X509.pdf";
 public static final String ENCIPHERED = "./X509-crypt.pdf";
 public static final String DECIPHERED = "./X509-decrypt.pdf";
 public static final String SIGNED = "./X509-signed.pdf";

public static void main(String[] args) {
 Security.addProvider(new 
org.bouncycastle.jce.provider.BouncyCastleProvider());

 Certificate readerCert = null;
 System.out.println(Cipher.getMaxAllowedKeyLength("AES")); // OK
 KeyPair pair = generateKeyPair("RSA", 2048);
 readerCert = getCertificate(pair);
 System.out.println(readerCert);

 KeyPair fakePair = generateKeyPair("RSA", 2048);
 Certificate fakeCertificate = getCertificate(fakePair);
 encryptPdf(ORIGINAL, ENCIPHERED, readerCert);
 }

My configuration:
OS: Windows 7 x64 service pack 1
Jdk and Jre latest version 1.6.26
Itext latest version 5.11
IDE: netbeans 7.0

I've given a look at what happened inside Itext and i found that the 
instruction that launch exception is:
"System.arraycopy(key, 0, mkey, 0, mkey.length);"
where key is a 20 bytes arrays and mkey.length is 32!

With the other algorithm (ARC4_40, ARC4_128, AES_128) i have no problem!

I attach the pdf that i want to encipher.

I thank you in advance
Alex Miller.


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 info

Re: [iText-questions] ArrayIndexOutOfBoundsException

2010-09-14 Thread 1T3XT info
On 14/09/2010 21:01, Samy wrote:
> Hi, I am using the iText 1.3 jar

Sorry, that version is no longer supported.
If you can reproduce the problem with the latest version,
we can take a look at it.
If you want to keep on using a version that is 5 years old,
you're on your own.
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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/


[iText-questions] ArrayIndexOutOfBoundsException

2010-09-14 Thread Samy

Hi,

I am using the iText 1.3 jar file to run a Java Agent on Lotus Notes, which
does merge the PDFs.
I have been facing an issue for a while now when I select two or three
documents (which are PDFs) and click on MergeDoc, I get this series of
errors. 

This nature of throwing errors does not happen in a pattern, very sporadic.
9 out 10 times it works fine.



Please take a look at the stacktrace below:
-

java.lang.ArrayIndexOutOfBoundsException: Array index out of range: -1
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:124)
at com.lowagie.text.pdf.OutputStreamCounter.write(Unknown Source)
at com.lowagie.text.pdf.PRStream.toPdf(Unknown Source)
at com.lowagie.text.pdf.PdfIndirectObject.writeTo(Unknown Source)
at com.lowagie.text.pdf.PdfWriter$PdfBody.add(Unknown Source)
at com.lowagie.text.pdf.PdfWriter$PdfBody.add(Unknown Source)
at com.lowagie.text.pdf.PdfWriter.addToBody(Unknown Source)
at com.lowagie.text.pdf.PdfCopyFieldsImp.closeIt(Unknown Source)
at com.lowagie.text.pdf.PdfCopyFieldsImp.close(Unknown Source)
at com.lowagie.text.pdf.PdfCopyFields.close(Unknown Source)
at JavaAgent.NotesMain(JavaAgent.java:61)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)


-



Here is the code I use to merge documents:

public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();

// getting the configuration profile
Database db = agentContext.getCurrentDatabase();
View confView = db.getView("Configuration");


Document confDoc = confView.getFirstDocument();
DocumentCollection dc = 
agentContext.getUnprocessedDocuments();
Document doc = dc.getFirstDocument();

// final merged pdf file
PdfCopyFields copy = new PdfCopyFields(new
FileOutputStream(confDoc.getItemValueString("temp")+ "MergedDoc.pdf"));

//looping through documents
while (doc != null) {

RichTextItem rtitem = (RichTextItem) 
doc.getFirstItem("Body");

if (rtitem != null) {
EmbeddedObject obj = (EmbeddedObject)
rtitem.getEmbeddedObjects().elementAt(0);

if (obj.getType() == 
EmbeddedObject.EMBED_ATTACHMENT) {


String fileName = 
obj.getSource();

PdfReader reader1;

// this is to check whether the 
document is already merged with
another pdf's

if 
(fileName.equals("MergedDoc.pdf")) {
// extracting the 
existing pdf

obj.extractFile(confDoc.getItemValueString("temp")+ "ALLPAGES.pdf");
reader1 = new 
PdfReader(confDoc.getItemValueString("temp")+
"ALLPAGES.pdf");

} else {


obj.extractFile(confDoc.getItemValueString("temp")+ obj.getSource());
reader1 = new 
PdfReader(confDoc.getItemValueString("temp")+
obj.getSource());

}

copy.addDocument(reader1);
reader1 = null;

}
}

doc = dc.getNextDocument();
}

if (copy != null)
copy.close();

 

Re: [iText-questions] ArrayIndexOutOfBoundsException when signing Documaker PDF

2010-05-06 Thread mkl

Paulo,


Paulo Soares-3 wrote:
> What should iText put in the missing bytes to fill the 16 positions: all
> zeros or something else?

No, IMO it should just use the bytes given, not more, not less.

Regards,   Michael.
-- 
View this message in context: 
http://old.nabble.com/ArrayIndexOutOfBoundsException-when-signing-Documaker-PDF-tp28466347p28473599.html
Sent from the iText - General mailing list archive at Nabble.com.


--
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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/


Re: [iText-questions] ArrayIndexOutOfBoundsException when signing Documaker PDF

2010-05-06 Thread Paulo Soares
What should iText put in the missing bytes to fill the 16 positions: all zeros 
or something else?

Paulo 

-Original Message-
From: mkl [mailto:m...@wir-sind-cool.org] 
Sent: Thursday, May 06, 2010 2:01 PM
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] ArrayIndexOutOfBoundsException when signing 
Documaker PDF


msinatl,


msinatl wrote:
> Thanks for your response. Please pardon my ignorance, but what is the
> document ID and how can I retrieve it?

If you look at the PDF document using a text or hex viewer or a dedicated
PDF analysis tool, you'll find the trailer dictionary nearly at the end of
it. In the case of your example document 
http://old.nabble.com/file/p28472754/74AA0C69-01F4-4114-6A2D-81D7E7101480-0-IDS-1-BLP.PDF
74AA0C69-01F4-4114-6A2D-81D7E7101480-0-IDS-1-BLP.PDF :

trailer
<>

The document ID is the entryin square brackets after the /ID name, i.e. (22)
(22). This is wrong. The PDF spec ISO 32000-1:2008 states in 14.4:


File identifiers shall be defined by the optional ID entry in a PDF file's
trailer dictionary (see 7.5.5, "File Trailer"). The ID entry is optional but
should be used. The value of this entry shall be an array of two byte
strings. The first byte string shall be a permanent identifier based on the
contents of the file at the time it was originally created and shall not
change when the file is incrementally updated. The second byte string shall
be a changing identifier based on the file's contents at the time it was
last updated. When a file is first written, both identifiers shall be set to
the same value. If both identifiers match when a file reference is resolved,
it is very likely that the correct and unchanged file has been found. If
only the first identifier matches, a different version of the correct file
has been found.

To help ensure the uniqueness of file identifiers, they should be computed
by means of a message digest algorithm such as MD5 (described in Internet
RFC 1321, The MD5 Message-Digest Algorithm.


At first glance, that ID of yours is wrong as it uses literal strings and
not byte strings. It additionally is likely wrong as a two-character ID
generally does not ensure uniqueness.

On the other hand iText is wrong in assuming a length of exactly 16 bytes in
PdfEncryption.createInfoId() because the MD5 digest is merely an example for
a way to generate something unique enough.

Regards,   Michael.

-- 
View this message in context: 
http://old.nabble.com/ArrayIndexOutOfBoundsException-when-signing-Documaker-PDF-tp28466347p28473274.html
Sent from the iText - General mailing list archive at Nabble.com.


--
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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/

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.


--
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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/

Re: [iText-questions] ArrayIndexOutOfBoundsException when signing Documaker PDF

2010-05-06 Thread msinatl

Thanks, Michael - that is exactly what I needed to know!  I will take this
issue up with Oracle.

I will also see if I can find some work-around to make the file acceptable
to iText.  Maybe I can edit the ID or re-save the file before trying to sign
it, forcing the generation of a new ID?


mkl wrote:
> 
> msinatl,
> 
> 
> msinatl wrote:
>> Thanks for your response. Please pardon my ignorance, but what is the
>> document ID and how can I retrieve it?
> 
> If you look at the PDF document using a text or hex viewer or a dedicated
> PDF analysis tool, you'll find the trailer dictionary nearly at the end of
> it. In the case of your example document 
> http://old.nabble.com/file/p28472754/74AA0C69-01F4-4114-6A2D-81D7E7101480-0-IDS-1-BLP.PDF
> 74AA0C69-01F4-4114-6A2D-81D7E7101480-0-IDS-1-BLP.PDF :
> 
> trailer
> <>
> 
> The document ID is the entryin square brackets after the /ID name, i.e.
> (22) (22). This is wrong. The PDF spec ISO 32000-1:2008 states in 14.4:
> 
> 
> File identifiers shall be defined by the optional ID entry in a PDF file’s
> trailer dictionary (see 7.5.5, “File Trailer”). The ID entry is optional
> but should be used. The value of this entry shall be an array of two byte
> strings. The first byte string shall be a permanent identifier based on
> the contents of the file at the time it was originally created and shall
> not change when the file is incrementally updated. The second byte string
> shall be a changing identifier based on the file’s contents at the time it
> was last updated. When a file is first written, both identifiers shall be
> set to the same value. If both identifiers match when a file reference is
> resolved, it is very likely that the correct and unchanged file has been
> found. If only the first identifier matches, a different version of the
> correct file has been found.
> 
> To help ensure the uniqueness of file identifiers, they should be computed
> by means of a message digest algorithm such as MD5 (described in Internet
> RFC 1321, The MD5 Message-Digest Algorithm.
> 
> 
> At first glance, that ID of yours is wrong as it uses literal strings and
> not byte strings. It additionally is likely wrong as a two-character ID
> generally does not ensure uniqueness.
> 
> On the other hand iText is wrong in assuming a length of exactly 16 bytes
> in PdfEncryption.createInfoId() because the MD5 digest is merely an
> example for a way to generate something unique enough.
> 
> Regards,   Michael.
> 
> 

-- 
View this message in context: 
http://old.nabble.com/ArrayIndexOutOfBoundsException-when-signing-Documaker-PDF-tp28466347p28473350.html
Sent from the iText - General mailing list archive at Nabble.com.


--
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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/

Re: [iText-questions] ArrayIndexOutOfBoundsException when signing Documaker PDF

2010-05-06 Thread mkl

msinatl,


msinatl wrote:
> Thanks for your response. Please pardon my ignorance, but what is the
> document ID and how can I retrieve it?

If you look at the PDF document using a text or hex viewer or a dedicated
PDF analysis tool, you'll find the trailer dictionary nearly at the end of
it. In the case of your example document 
http://old.nabble.com/file/p28472754/74AA0C69-01F4-4114-6A2D-81D7E7101480-0-IDS-1-BLP.PDF
74AA0C69-01F4-4114-6A2D-81D7E7101480-0-IDS-1-BLP.PDF :

trailer
<>

The document ID is the entryin square brackets after the /ID name, i.e. (22)
(22). This is wrong. The PDF spec ISO 32000-1:2008 states in 14.4:


File identifiers shall be defined by the optional ID entry in a PDF file’s
trailer dictionary (see 7.5.5, “File Trailer”). The ID entry is optional but
should be used. The value of this entry shall be an array of two byte
strings. The first byte string shall be a permanent identifier based on the
contents of the file at the time it was originally created and shall not
change when the file is incrementally updated. The second byte string shall
be a changing identifier based on the file’s contents at the time it was
last updated. When a file is first written, both identifiers shall be set to
the same value. If both identifiers match when a file reference is resolved,
it is very likely that the correct and unchanged file has been found. If
only the first identifier matches, a different version of the correct file
has been found.

To help ensure the uniqueness of file identifiers, they should be computed
by means of a message digest algorithm such as MD5 (described in Internet
RFC 1321, The MD5 Message-Digest Algorithm.


At first glance, that ID of yours is wrong as it uses literal strings and
not byte strings. It additionally is likely wrong as a two-character ID
generally does not ensure uniqueness.

On the other hand iText is wrong in assuming a length of exactly 16 bytes in
PdfEncryption.createInfoId() because the MD5 digest is merely an example for
a way to generate something unique enough.

Regards,   Michael.

-- 
View this message in context: 
http://old.nabble.com/ArrayIndexOutOfBoundsException-when-signing-Documaker-PDF-tp28466347p28473274.html
Sent from the iText - General mailing list archive at Nabble.com.


--
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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/

Re: [iText-questions] ArrayIndexOutOfBoundsException when signing Documaker PDF

2010-05-06 Thread msinatl

Michael,

Thanks for your response. Please pardon my ignorance, but what is the
document ID and how can I retrieve it?

It seems that PdfEncryption.java has a createDocumentId() method that builds
the document ID from some semi-random elements:

public static byte[] createDocumentId() {
MessageDigest md5;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (Exception e) {
throw new ExceptionConverter(e);
}
long time = System.currentTimeMillis();
long mem = Runtime.getRuntime().freeMemory();
String s = time + "+" + mem + "+" + (seq++);
return md5.digest(s.getBytes());
}

Anyway, here is an example file, generated by Documaker, that I am working
with.




mkl wrote:
> 
> msinatl,
> 
> 
> msinatl wrote:
>> I've got a problem using iText to digitally sign a PDF.  The Groovy
>> script below works fine with a test PDF I created in Acrobat Pro 7.0. 
>> But when I run it on a PDF produced by my production document system
>> (Oracle Documaker), I get this exception: 
>> 
>> java.lang.ArrayIndexOutOfBoundsException: 2 
>> at 
>> com.itextpdf.text.pdf.PdfEncryption.createInfoId(PdfEncryption.java:401) 
>> 
>> I'm using iText 5.0.2, JDK 1.6, and Groovy 1.5.6.
> 
> At PdfEncryption.java:401 iText creates the literal representation of a
> document ID from a byte[] representation. iText stumbles as the byte[]
> parameter is merely 2 bytes long, not 16 as expected. You might want to
> look at the ID in your source document.
> 
> (Ok, the code of createInfoId might be made more fool-proof by checking
> the byte[] parameter, but for valid PDFs the assumptions implicitely made
> here are correct.)
> 
> If that ID looks ok in your document, please forward that document (or any
> other one making that issue reproducible) for inspection.
> 
> Regards,   Michael.
> 
http://old.nabble.com/file/p28472754/74AA0C69-01F4-4114-6A2D-81D7E7101480-0-IDS-1-BLP.PDF
74AA0C69-01F4-4114-6A2D-81D7E7101480-0-IDS-1-BLP.PDF 
-- 
View this message in context: 
http://old.nabble.com/ArrayIndexOutOfBoundsException-when-signing-Documaker-PDF-tp28466347p28472754.html
Sent from the iText - General mailing list archive at Nabble.com.


--
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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/


Re: [iText-questions] ArrayIndexOutOfBoundsException when signing Documaker PDF

2010-05-06 Thread mkl

msinatl,


msinatl wrote:
> I've got a problem using iText to digitally sign a PDF.  The Groovy script
> below works fine with a test PDF I created in Acrobat Pro 7.0.  But when I
> run it on a PDF produced by my production document system (Oracle
> Documaker), I get this exception: 
> 
> java.lang.ArrayIndexOutOfBoundsException: 2 
> at 
> com.itextpdf.text.pdf.PdfEncryption.createInfoId(PdfEncryption.java:401) 
> 
> I'm using iText 5.0.2, JDK 1.6, and Groovy 1.5.6.

At PdfEncryption.java:401 iText creates the literal representation of a
document ID from a byte[] representation. iText stumbles as the byte[]
parameter is merely 2 bytes long, not 16 as expected. You might want to look
at the ID in your source document.

(Ok, the code of createInfoId might be made more fool-proof by checking the
byte[] parameter, but for valid PDFs the assumptions implicitely made here
are correct.)

If that ID looks ok in your document, please forward that document (or any
other one making that issue reproducible) for inspection.

Regards,   Michael.
-- 
View this message in context: 
http://old.nabble.com/ArrayIndexOutOfBoundsException-when-signing-Documaker-PDF-tp28466347p28470201.html
Sent from the iText - General mailing list archive at Nabble.com.


--
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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/


[iText-questions] ArrayIndexOutOfBoundsException when signing Documaker PDF

2010-05-05 Thread MSilverboard
Hi, 

I've got a problem using iText to digitally sign a PDF.  The Groovy script 
below works fine with a test PDF I created in Acrobat Pro 7.0.  But when I 
run it on a PDF produced by my production document system (Oracle 
Documaker), I get this exception: 

java.lang.ArrayIndexOutOfBoundsException: 2 
at 
com.itextpdf.text.pdf.PdfEncryption.createInfoId(PdfEncryption.java:401) 

I'm using iText 5.0.2, JDK 1.6, and Groovy 1.5.6. 

Both PDFs are encrypted before my script begins - with printing and 
signing allowed, but changing of the document prohibited.  The Acrobat 7 
PDF is PDF Version 1.6; the Documaker PDF is PDF Version 1.4.  Both are 
encrypted with 128-bit RC4.  I don't know where to look for any other 
material differences between the two files. 

Does anyone have any thoughts on why iText throws an exception when trying 
to sign the Documaker-generated PDFs? 


import java.security.KeyStore 
import java.security.PrivateKey 
import java.security.cert.Certificate 
import com.itextpdf.text.pdf.PdfReader 
import com.itextpdf.text.pdf.PdfStamper 
import com.itextpdf.text.pdf.PdfWriter 
import com.itextpdf.text.pdf.PdfSignatureAppearance 
import com.itextpdf.text.pdf.PdfName 
import com.itextpdf.text.Image 
import com.itextpdf.text.Rectangle 

static String sign( 
String keyFile, 
String keyFilePassword, 
String inFile, 
String ownerPassword, 
String reason, 
String location, 
String signer, 
String sigFieldName, 
String outFile 
) { 
try { 
KeyStore ks = KeyStore.getInstance("pkcs12") 
ks.load(new FileInputStream(keyFile), 
keyFilePassword.toCharArray()) 
String alias = (String)ks.aliases().nextElement() 
PrivateKey key = (PrivateKey)ks.getKey(alias, 
keyFilePassword.toCharArray()) 
Certificate[] chain = ks.getCertificateChain(alias) 
PdfReader reader = new PdfReader(inFile, 
ownerPassword.getBytes()) 
FileOutputStream fout = new FileOutputStream(outFile) 
// Groovy thinks '\0' is a GString, so we have to be 
explicit and force it to char. 
PdfStamper stp = PdfStamper.createSignature(reader, fout, 
'\0'.toCharacter().charValue(), null, true) 
stp.getWriter().setPdfVersion(PdfWriter.PDF_VERSION_1_6) 
PdfSignatureAppearance sap = stp.getSignatureAppearance() 
sap.setCrypto(key, chain, null, 
PdfSignatureAppearance.WINCER_SIGNED) 
sap.setReason(reason) 
sap.setLocation(location) 
sap.setLayer2Text(signer) 
sap.setVisibleSignature(sigFieldName) 
stp.close() 
return outFile 
} catch (Throwable t) { 
println t 
} 
} 

String outfile = sign( 
"C:/certs/eAppTest_20110429.pfx", 
[redacted], 
"C:/certs/72567C71-D0AD-ADAB-E6EE-D464F714650C-0-IDS-1-BLP.PDF", 
[redacted], 
"reason", 
"location", 
"Foo Bar", 
"insuredSignature", 
 "C:/certs/72567C71-D0AD-ADAB-E6EE-D464F714650C-0-IDS-1-BLP-signed.PDF" 
) 

println "Signed ${outfile}"
--
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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/

Re: [iText-questions] ArrayIndexOutOfBoundsException

2009-10-05 Thread Paulo Soares
Your jpeg is broken in the icc profile segment count. I'll add something in 
the code to take care of this.

Paulo

- Original Message - 
From: "Marc Campforts" 
To: 
Sent: Monday, October 05, 2009 12:51 PM
Subject: [iText-questions] ArrayIndexOutOfBoundsException


Following code gives ArrayIndexOutOfBoundsException:
I give the location of the jpeg attached as first argument.
public class LowagieImage {

public static void main(String[] args) {
try {
com.lowagie.text.Image image =
com.lowagie.text.Image.getInstance(args[0]);
}
catch (Exception e) {
e.printStackTrace();
}
}
}
This jpeg displays correct in a browser.
other jpeg files are working fine.
Is this a program error or is there something wrong with the jpeg.

regards,
Marc

-- 
HelpServer - The other way to organize help and documentation
===
Marc Campforts  System Engineer
4.ST Belgium N.V.Tel: +32(0)16 40.40.54
Technologielaan 21-b1Fax: +32(0)16 40.50.50
B-3001 Leuven Email: marc.campfo...@4st.com
BelgiumWWW: http://www.4st.com/
===



--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
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/


Re: [iText-questions] ArrayIndexOutOfBoundsException

2009-10-05 Thread Mark Storer
Please post the full exception.

--Mark Storer 
  Senior Software Engineer 
  Cardiff.com

#include  
typedef std::Disclaimer DisCard; 



> -Original Message-
> From: Marc Campforts [mailto:marc.campfo...@4st.com]
> Sent: Monday, October 05, 2009 4:51 AM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] ArrayIndexOutOfBoundsException
> 
> 
> Following code gives ArrayIndexOutOfBoundsException:
> I give the location of the jpeg attached as first argument.
> public class LowagieImage {
> 
> public static void main(String[] args) {
> try {
> com.lowagie.text.Image image = 
> com.lowagie.text.Image.getInstance(args[0]);
> }
> catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> This jpeg displays correct in a browser.
> other jpeg files are working fine.
> Is this a program error or is there something wrong with the jpeg.
> 
> regards,
> Marc
> 
> -- 
> HelpServer - The other way to organize help and documentation
> ===
> Marc Campforts  System Engineer
> 4.ST Belgium N.V.Tel: +32(0)16 40.40.54
> Technologielaan 21-b1Fax: +32(0)16 40.50.50
> B-3001 Leuven Email: marc.campfo...@4st.com
> BelgiumWWW: http://www.4st.com/
> ===
> 
> 

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
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/


Re: [iText-questions] ArrayIndexOutOfBoundsException resulting from Table.mergeInsertedTables()

2005-05-11 Thread bruno
Peter Hodgkinson wrote:
The culprit is the convertWidth function which formats the floating values to
the number format "0.00". In my case, for example, wb was: 54.57034 and wt was:
54.57619. After returning from the the convertWidth function the values were:
54.57 and 54.58 respectively it's a rounding problem.
My solution:
Change the line
if(convertWidth(wb)==convertWidth(wt)) break;
to
if(convertWidth(wt)>=convertWidth(wb)) break;
or
change
private static DecimalFormat widthFormat = new DecimalFormat( "0.00");
to
private static DecimalFormat widthFormat = new DecimalFormat( "0.0");
Disclamer:
I'm not sure what impact these changes will have in every concievable case, but
they both worked for me and I thought I'd share.
Thanks,
I did a RefactorIt Audit once and the problem you are describing is 
called a 'Dangerous Comparison'. RefactorIt recommends to solve it like 
this:
if(Math.abs(convertWidth(wb) - convertWidth(wt)) < 0.0001) break;
0.0001 is a precision you can chose yourself.
I have changed this one case, but I am aware of the fact that I should 
follow the RefactorIt suggestions in a lot of other cases too. 
Unfortunately the number of suggestions bu RefactorIt is so 
overwhelming, that I don't know where to start...
br,
Bruno

---
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions


[iText-questions] ArrayIndexOutOfBoundsException resulting from Table.mergeInsertedTables()

2005-05-10 Thread Peter Hodgkinson
I've noted that this problem has been discussed in a few threads around here,
and I've spend the past day and a half trying to debug it. Here's the problem /
solution I found.

The problem:
the following block in mergeInsertedTables

 while( ct=convertWidth(wb)) break;

or

change
private static DecimalFormat widthFormat = new DecimalFormat( "0.00");
to
private static DecimalFormat widthFormat = new DecimalFormat( "0.0");

Disclamer:
I'm not sure what impact these changes will have in every concievable case, but
they both worked for me and I thought I'd share.






---
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions


[iText-questions] ArrayIndexOutOfBoundsException

2004-07-17 Thread Victor . Ayzenshtat

Hi, i'm trying to run your sample code to create nested tables within a PDF document and i get :

java.lang.ArrayIndexOutOfBoundsException: 3
        at com.lowagie.text.Table.mergeInsertedTables(Unknown Source)
        at com.lowagie.text.Table.complete(Unknown Source)
        at com.lowagie.text.Table.insertTable(Unknown Source)
        at com.lowagie.text.Table.addCell(Unknown Source)
        at com.lowagie.text.Table.addCell(Unknown Source)


when the red line (aTable.addCell(tableCell, new Point(1,1));) in the code below executes.  This is the sample code from iText tutorial site.  I tried to create my own nested tables and my code also always fails on that same line.  Why does that happen?  Any help would be appreciated!  I use JDK 1.4x

thanks in advance,
-regards, 

Victor

===

/*
 * $Id: Chap0516.java,v 1.6 2003/06/25 07:36:33 blowagie Exp $
 * $Name:  $
 *
 * This code is free software. It may only be copied or modified
 * if you include the following copyright notice:
 *
 * --> Copyright 2001 by Bruno Lowagie, Geert Poels, Chris Zachary <--
 *
 * This code is part of the 'iText Tutorial'.
 * You can find the complete tutorial at the following address:
 * http://www.lowagie.com/iText/tutorial/
 *
 * This code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * [EMAIL PROTECTED]
 */
import java.awt.Point;
import java.io.FileOutputStream;
import java.io.IOException;
import com.lowagie.text.*;
import com.lowagie.text.pdf.PdfWriter;

public class Chap0516 {
    
    public static void main(String[] args) {
        System.out.println("Chapter 5 example 16: nested tables");
        // step 1: creation of a document-object
        Document document = new Document(PageSize.A4.rotate());
        try {
            // step 2:
            // we create a writer that listens to the document
            // and directs a PDF-stream to a file
            PdfWriter.getInstance(document, new FileOutputStream("Chap0516.pdf"));
            // step 3: we open the document
            document.open();
            // step 4: we create a table and add it to the document
            Table secondTable = new Table(2);
            secondTable.addCell("2nd table 0.0");
            secondTable.addCell("2nd table 0.1");
            secondTable.addCell("2nd table 1.0");
            secondTable.addCell("2nd table 1.1");
            Cell tableCell = new Cell("This is a nested table");
            tableCell.add(secondTable);
            
            Table aTable = new Table(3,3);    // 3 rows, 3 columns
            aTable.addCell("0.0", new Point(0,0));
            aTable.addCell("0.1", new Point(0,1));
            aTable.addCell("0.2", new Point(0,2));
            aTable.addCell("0.0", new Point(1,0));
            aTable.addCell(tableCell, new Point(1,1));
            aTable.addCell("2.2", new Point(1,2));
            aTable.addCell("2.0", new Point(2,0));
            aTable.addCell("2.1", new Point(2,1));
            aTable.addCell("2.2", new Point(2,2));
            document.add(aTable);
        }
        catch(DocumentException de) {
            System.err.println(de.getMessage());
        }
        catch(IOException ioe) {
            System.err.println(ioe.getMessage());
        }
        // step 5: we close the document
        document.close();
    }
    
}
---
Victor Ayzenshtat
Federal Reserve Bank of New York
phone: (212) 720-2096
fax: (212) 720-1302

Re: [iText-questions] ArrayIndexOutOfBoundsException when masking an image

2003-07-30 Thread Chris . Rauschuber

Hi Paulo,

Thanks for your help.  I converted the JPEG to a PNG and got a better
result.  The masked image is still a little sketchy, but I think it is good
enough.

Thanks again,
Chris



   
  
"Paulo Soares" 
  
<[EMAIL PROTECTED]   To: <[EMAIL PROTECTED]>   

ste.pt>  cc: <[EMAIL PROTECTED]>   
  
     Subject: Re: [iText-questions] 
ArrayIndexOutOfBoundsException when masking an image 
07/29/2003 
  
06:38 PM   
  
   
  
   
  





- Original Message -
From: <[EMAIL PROTECTED]>
To: "Paulo Soares" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, July 29, 2003 22:20
Subject: Re: [iText-questions] ArrayIndexOutOfBoundsException when masking
an image


>
> Hi Paulo,
>
> Thanks for the quick response.
> The original image is a JPEG.
>

Very, very bad choice. The compression artifacts will show up if you try to
apply transparency.


> Why is that formula used?  On the tutorial, an 8 X 8 mask uses 8 bytes,
> but
> would be 15 bytes using the formula below.

This is integer calculation. The bits are packed but a line is padded to
fill the last byte. No byte spans two lines.

>
> So, assuming that I need 888 bytes for a mask with 6750 pixels, how are
> the
> byte values computed?
>

You'll need (135+7)/8 * 50 = 850 bytes.

Best Regards,
Paulo Soares

> Thanks for your help,
> Chris
>
>
>
>
>
> "Paulo Soares"
>
> <[EMAIL PROTECTED]>   To:
> <[EMAIL PROTECTED]>,
> <[EMAIL PROTECTED]>
> Sent by:cc:
>
> [EMAIL PROTECTED]   Subject:
> Re: [iText-questions] ArrayIndexOutOfBoundsException when masking an
> image
> eforge.net
>
>
>
>
>
> 07/29/2003 02:25 PM
>
>
>
>
>
>
>
>
>
> The number of bytes must be:
>
> (width+7)/8 * height
>
> What is your original image format before the PlanarImage?
>
> Best Regards,
> Paulo Soares
>
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 29, 2003 19:50
> Subject: [iText-questions] ArrayIndexOutOfBoundsException when masking
> an
> image
>
>
> > Hello,
> >
> > I have an image of a signature with height=50 and width=135 that I
> would
> > like to insert into a PDF.  I would like to mask it with the signature
> > itself so that the white background of the image is gone and only the
> > signature remains.  I've tried using the code below to do this, but I
> > get
> > the following exception.  Am I constructing the mask correctly?  I
> > assumed
> > that the number of bytes in the mask should be equal to the ceiling of
> > the
> > number of pixels divided by 8(844 in this case).  Is this correct?
> >
> > java.lang.ArrayIndexOutOfBoundsException: 844
> > at com.lowagie.text.pdf.CCITTG4Encoder.nextState(Unknown
> Source)
> > at com.lowagie.text.pdf.CCITTG4Encoder.encodeT6(Unknown
> Source)
> > at com.lowagie.text.pdf.CCITTG4Encoder.compress(Unknown
> Source)
> > at com.lowagie.text.Image.getInstance(Unknown Source)
> > at com.lowagie.text.Image.getInstance(Unknown Source)
> >
> >
> > Here is the code:
> >  
> >  PlanarImage planarImage = getPlanarImage(value);
> >  byte[] mask = createMask(planarImage);
> >  Image maskImage =
> > Image.getInstance(
> >planarImage.getData().getWidth(),
> >planarImage.getData().getHeight(),
> >1,
> >1,
> >mask);
> >
> >  maskIm

Re: [iText-questions] ArrayIndexOutOfBoundsException when masking an image

2003-07-29 Thread Paulo Soares

- Original Message -
From: <[EMAIL PROTECTED]>
To: "Paulo Soares" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, July 29, 2003 22:20
Subject: Re: [iText-questions] ArrayIndexOutOfBoundsException when masking
an image


>
> Hi Paulo,
>
> Thanks for the quick response.
> The original image is a JPEG.
>

Very, very bad choice. The compression artifacts will show up if you try to
apply transparency.


> Why is that formula used?  On the tutorial, an 8 X 8 mask uses 8 bytes,
> but
> would be 15 bytes using the formula below.

This is integer calculation. The bits are packed but a line is padded to
fill the last byte. No byte spans two lines.

>
> So, assuming that I need 888 bytes for a mask with 6750 pixels, how are
> the
> byte values computed?
>

You'll need (135+7)/8 * 50 = 850 bytes.

Best Regards,
Paulo Soares

> Thanks for your help,
> Chris
>
>
>
>
>
> "Paulo Soares"
>
> <[EMAIL PROTECTED]>   To:
> <[EMAIL PROTECTED]>,
> <[EMAIL PROTECTED]>
> Sent by:cc:
>
> [EMAIL PROTECTED]   Subject:
> Re: [iText-questions] ArrayIndexOutOfBoundsException when masking an
> image
> eforge.net
>
>
>
>
>
> 07/29/2003 02:25 PM
>
>
>
>
>
>
>
>
>
> The number of bytes must be:
>
> (width+7)/8 * height
>
> What is your original image format before the PlanarImage?
>
> Best Regards,
> Paulo Soares
>
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 29, 2003 19:50
> Subject: [iText-questions] ArrayIndexOutOfBoundsException when masking
> an
> image
>
>
> > Hello,
> >
> > I have an image of a signature with height=50 and width=135 that I
> would
> > like to insert into a PDF.  I would like to mask it with the signature
> > itself so that the white background of the image is gone and only the
> > signature remains.  I've tried using the code below to do this, but I
> > get
> > the following exception.  Am I constructing the mask correctly?  I
> > assumed
> > that the number of bytes in the mask should be equal to the ceiling of
> > the
> > number of pixels divided by 8(844 in this case).  Is this correct?
> >
> > java.lang.ArrayIndexOutOfBoundsException: 844
> > at com.lowagie.text.pdf.CCITTG4Encoder.nextState(Unknown
> Source)
> > at com.lowagie.text.pdf.CCITTG4Encoder.encodeT6(Unknown
> Source)
> > at com.lowagie.text.pdf.CCITTG4Encoder.compress(Unknown
> Source)
> > at com.lowagie.text.Image.getInstance(Unknown Source)
> > at com.lowagie.text.Image.getInstance(Unknown Source)
> >
> >
> > Here is the code:
> >  
> >  PlanarImage planarImage = getPlanarImage(value);
> >  byte[] mask = createMask(planarImage);
> >  Image maskImage =
> > Image.getInstance(
> >planarImage.getData().getWidth(),
> >planarImage.getData().getHeight(),
> >1,
> >1,
> >mask);
> >
> >  maskImage.makeMask();
> >  maskImage.setInvertMask(true);
> >
> >  image.setAbsolutePosition(pageTokenDefinition.getX(),
> > pageTokenDefinition.getY());
> >  image.setImageMask(maskImage);
> >  pdfTemplate.addImage(image);
> >  
> >
> >private static byte[] createMask(PlanarImage image) {
> >   double[][] pixels = imageToBandArray(image, 0);
> >   int width = pixels[0].length;
> >   int height = pixels.length;
> >   byte[] mask = new byte[(int)Math.ceil(width * height / 8.0)];
> >   int maskIndex = 0;
> >   for (int pixelIndex = 0; pixelIndex < width * height;
> > pixelIndex++) {
> >  if (pixels[pixelIndex / width][pixelIndex % width] == 0) {
> > mask[(int)Math.floor(pixelIndex / 8.0)] |= (1 << (7 -
> > pixelIndex % 8));
> >  }
> >   }
> >   return mask;
> >}
> >
> >public static double[][] imageToBandArray(PlanarImage image, int
> > band) {
> >   Raster raster = image.getData();
> >   int width = raster.getWidth();
> >   int height = raster.getHeight();
> >   int bands = raster.getNumBands();
> >   double[][] bandArray = new double[

Re: [iText-questions] ArrayIndexOutOfBoundsException when masking an image

2003-07-29 Thread Chris . Rauschuber

Hi Paulo,

Thanks for the quick response.
The original image is a JPEG.

Why is that formula used?  On the tutorial, an 8 X 8 mask uses 8 bytes, but
would be 15 bytes using the formula below.

So, assuming that I need 888 bytes for a mask with 6750 pixels, how are the
byte values computed?

Thanks for your help,
Chris



   
 
"Paulo Soares" 
 
<[EMAIL PROTECTED]>   To: <[EMAIL PROTECTED]>, 
<[EMAIL PROTECTED]>  
Sent by:cc:
 
[EMAIL PROTECTED]   Subject: Re: [iText-questions] 
ArrayIndexOutOfBoundsException when masking an image 
eforge.net 
 
   
 
   
 
07/29/2003 02:25 PM
 
   
 
   
 




The number of bytes must be:

(width+7)/8 * height

What is your original image format before the PlanarImage?

Best Regards,
Paulo Soares

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 29, 2003 19:50
Subject: [iText-questions] ArrayIndexOutOfBoundsException when masking an
image


> Hello,
>
> I have an image of a signature with height=50 and width=135 that I would
> like to insert into a PDF.  I would like to mask it with the signature
> itself so that the white background of the image is gone and only the
> signature remains.  I've tried using the code below to do this, but I
> get
> the following exception.  Am I constructing the mask correctly?  I
> assumed
> that the number of bytes in the mask should be equal to the ceiling of
> the
> number of pixels divided by 8(844 in this case).  Is this correct?
>
> java.lang.ArrayIndexOutOfBoundsException: 844
> at com.lowagie.text.pdf.CCITTG4Encoder.nextState(Unknown Source)
> at com.lowagie.text.pdf.CCITTG4Encoder.encodeT6(Unknown Source)
> at com.lowagie.text.pdf.CCITTG4Encoder.compress(Unknown Source)
> at com.lowagie.text.Image.getInstance(Unknown Source)
> at com.lowagie.text.Image.getInstance(Unknown Source)
>
>
> Here is the code:
>  
>  PlanarImage planarImage = getPlanarImage(value);
>  byte[] mask = createMask(planarImage);
>  Image maskImage =
> Image.getInstance(
>planarImage.getData().getWidth(),
>planarImage.getData().getHeight(),
>1,
>1,
>mask);
>
>  maskImage.makeMask();
>  maskImage.setInvertMask(true);
>
>  image.setAbsolutePosition(pageTokenDefinition.getX(),
> pageTokenDefinition.getY());
>  image.setImageMask(maskImage);
>  pdfTemplate.addImage(image);
>  
>
>private static byte[] createMask(PlanarImage image) {
>   double[][] pixels = imageToBandArray(image, 0);
>   int width = pixels[0].length;
>   int height = pixels.length;
>   byte[] mask = new byte[(int)Math.ceil(width * height / 8.0)];
>   int maskIndex = 0;
>   for (int pixelIndex = 0; pixelIndex < width * height;
> pixelIndex++) {
>  if (pixels[pixelIndex / width][pixelIndex % width] == 0) {
> mask[(int)Math.floor(pixelIndex / 8.0)] |= (1 << (7 -
> pixelIndex % 8));
>  }
>   }
>   return mask;
>}
>
>public static double[][] imageToBandArray(PlanarImage image, int
> band) {
>   Raster raster = image.getData();
>   int width = raster.getWidth();
>   int height = raster.getHeight();
>   int bands = raster.getNumBands();
>   double[][] bandArray = new double[height][width];
>   for (int n = 0; n 

Re: [iText-questions] ArrayIndexOutOfBoundsException when masking an image

2003-07-29 Thread Paulo Soares
The number of bytes must be:

(width+7)/8 * height

What is your original image format before the PlanarImage?

Best Regards,
Paulo Soares

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 29, 2003 19:50
Subject: [iText-questions] ArrayIndexOutOfBoundsException when masking an
image


> Hello,
>
> I have an image of a signature with height=50 and width=135 that I would
> like to insert into a PDF.  I would like to mask it with the signature
> itself so that the white background of the image is gone and only the
> signature remains.  I've tried using the code below to do this, but I
> get
> the following exception.  Am I constructing the mask correctly?  I
> assumed
> that the number of bytes in the mask should be equal to the ceiling of
> the
> number of pixels divided by 8(844 in this case).  Is this correct?
>
> java.lang.ArrayIndexOutOfBoundsException: 844
> at com.lowagie.text.pdf.CCITTG4Encoder.nextState(Unknown Source)
> at com.lowagie.text.pdf.CCITTG4Encoder.encodeT6(Unknown Source)
> at com.lowagie.text.pdf.CCITTG4Encoder.compress(Unknown Source)
> at com.lowagie.text.Image.getInstance(Unknown Source)
> at com.lowagie.text.Image.getInstance(Unknown Source)
>
>
> Here is the code:
>  
>  PlanarImage planarImage = getPlanarImage(value);
>  byte[] mask = createMask(planarImage);
>  Image maskImage =
> Image.getInstance(
>planarImage.getData().getWidth(),
>planarImage.getData().getHeight(),
>1,
>1,
>mask);
>
>  maskImage.makeMask();
>  maskImage.setInvertMask(true);
>
>  image.setAbsolutePosition(pageTokenDefinition.getX(),
> pageTokenDefinition.getY());
>  image.setImageMask(maskImage);
>  pdfTemplate.addImage(image);
>  
>
>private static byte[] createMask(PlanarImage image) {
>   double[][] pixels = imageToBandArray(image, 0);
>   int width = pixels[0].length;
>   int height = pixels.length;
>   byte[] mask = new byte[(int)Math.ceil(width * height / 8.0)];
>   int maskIndex = 0;
>   for (int pixelIndex = 0; pixelIndex < width * height;
> pixelIndex++) {
>  if (pixels[pixelIndex / width][pixelIndex % width] == 0) {
> mask[(int)Math.floor(pixelIndex / 8.0)] |= (1 << (7 -
> pixelIndex % 8));
>  }
>   }
>   return mask;
>}
>
>public static double[][] imageToBandArray(PlanarImage image, int
> band) {
>   Raster raster = image.getData();
>   int width = raster.getWidth();
>   int height = raster.getHeight();
>   int bands = raster.getNumBands();
>   double[][] bandArray = new double[height][width];
>   for (int n = 0; n < height; n++) {
>  raster.getSamples(0, n, width, 1, band, bandArray[n]);
>   }
>   return bandArray;
>}
>
> Thanks,
> Chris
>
>
>
> ---
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01
> /01
> ___
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions


[iText-questions] ArrayIndexOutOfBoundsException when masking an image

2003-07-29 Thread Chris . Rauschuber
Hello,

I have an image of a signature with height=50 and width=135 that I would
like to insert into a PDF.  I would like to mask it with the signature
itself so that the white background of the image is gone and only the
signature remains.  I've tried using the code below to do this, but I get
the following exception.  Am I constructing the mask correctly?  I assumed
that the number of bytes in the mask should be equal to the ceiling of the
number of pixels divided by 8(844 in this case).  Is this correct?

java.lang.ArrayIndexOutOfBoundsException: 844
at com.lowagie.text.pdf.CCITTG4Encoder.nextState(Unknown Source)
at com.lowagie.text.pdf.CCITTG4Encoder.encodeT6(Unknown Source)
at com.lowagie.text.pdf.CCITTG4Encoder.compress(Unknown Source)
at com.lowagie.text.Image.getInstance(Unknown Source)
at com.lowagie.text.Image.getInstance(Unknown Source)


Here is the code:
 
 PlanarImage planarImage = getPlanarImage(value);
 byte[] mask = createMask(planarImage);
 Image maskImage =
Image.getInstance(
   planarImage.getData().getWidth(),
   planarImage.getData().getHeight(),
   1,
   1,
   mask);

 maskImage.makeMask();
 maskImage.setInvertMask(true);

 image.setAbsolutePosition(pageTokenDefinition.getX(),
pageTokenDefinition.getY());
 image.setImageMask(maskImage);
 pdfTemplate.addImage(image);
 

   private static byte[] createMask(PlanarImage image) {
  double[][] pixels = imageToBandArray(image, 0);
  int width = pixels[0].length;
  int height = pixels.length;
  byte[] mask = new byte[(int)Math.ceil(width * height / 8.0)];
  int maskIndex = 0;
  for (int pixelIndex = 0; pixelIndex < width * height; pixelIndex++) {
 if (pixels[pixelIndex / width][pixelIndex % width] == 0) {
mask[(int)Math.floor(pixelIndex / 8.0)] |= (1 << (7 -
pixelIndex % 8));
 }
  }
  return mask;
   }

   public static double[][] imageToBandArray(PlanarImage image, int band) {
  Raster raster = image.getData();
  int width = raster.getWidth();
  int height = raster.getHeight();
  int bands = raster.getNumBands();
  double[][] bandArray = new double[height][width];
  for (int n = 0; n < height; n++) {
 raster.getSamples(0, n, width, 1, band, bandArray[n]);
  }
  return bandArray;
   }

Thanks,
Chris



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions


RE: [iText-questions] ArrayIndexOutOfBoundsException

2002-05-15 Thread Paulo Soares

Can you prepare a working example with the problem for examination?

Best Regards,
Paulo Soares

> -Original Message-
> From: Ben Sinclair [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, May 14, 2002 16:50
> To:   [EMAIL PROTECTED]
> Subject:  Re: [iText-questions] ArrayIndexOutOfBoundsException
> 
> I just tried something new that might shed some light on my problem.
> 
> This is what I have been doing:
> 
> Create a temp pdf and a real pdf. Write to the temp pdf, close it, then
> import
> it into the real pdf.
> 
> Some of these variables are defined outside this method.
> 
> When I run this, I get the ArrayIndexOutOfBoundsException.
> 
>  tempPdf.close();
> 
>  System.out.println("tempPdf length: " + new
> File("rendertemp.pdf").length());
>  try {
> 
>   PdfReader reader = new PdfReader("rendertemp.pdf");
>   System.out.println("Number of pages: " + reader.getNumberOfPages());
> 
>   for (int i = 1; i <= reader.getNumberOfPages(); i++) {
>System.out.println("Adding page " + i);
>PdfImportedPage page = writer.getImportedPage(reader, i);
>PdfContentByte cb = writer.getDirectContent();
>cb.addTemplate(page,0,0); // Add temp pdf to the real pdf
> try {
> pdf.newPage();
>} catch (Exception e) {
> System.err.println("Error starting new page");
>}
>   }
> 
>  } catch (IOException e) {
>   System.err.println("Couldn't open rendertemp.pdf!");
>  }
> 
> 
> 
> Just for fun I tried to open an existing pdf that I didn't generate
> myself,
> instead of rendertemp.pdf. That worked fine. I then renamed the temp pdf
> and
> tried to append it, and that worked as well. It seems like if I generate
> my
> temp pdf, close it, then import it into my real pdf right away, it doesn't
> work.
> 
> Is there something more I have to do other than tempPdf.close() before I
> try
> and open it?
> 
> 
> --
> Ben Sinclair
> [EMAIL PROTECTED]
> 
> 
> - Original Message -
> From: "Ben Sinclair" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, May 13, 2002 12:47 PM
> Subject: Re: [iText-questions] ArrayIndexOutOfBoundsException
> 
> 
> > I know the PDF is probably totally invalid. Is there any way to make it
> throw
> > an exception indicating this before I call .close()? Since this occurs
> during
> > close(), I don't get anything into my new PDF.
> >
> 
> 
> ___
> 
> Have big pipes? SourceForge.net is looking for download mirrors. We supply
> the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
> ___
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions

___

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



Re: [iText-questions] ArrayIndexOutOfBoundsException

2002-05-14 Thread Ben Sinclair

I just tried something new that might shed some light on my problem.

This is what I have been doing:

Create a temp pdf and a real pdf. Write to the temp pdf, close it, then import
it into the real pdf.

Some of these variables are defined outside this method.

When I run this, I get the ArrayIndexOutOfBoundsException.

 tempPdf.close();

 System.out.println("tempPdf length: " + new File("rendertemp.pdf").length());
 try {

  PdfReader reader = new PdfReader("rendertemp.pdf");
  System.out.println("Number of pages: " + reader.getNumberOfPages());

  for (int i = 1; i <= reader.getNumberOfPages(); i++) {
   System.out.println("Adding page " + i);
   PdfImportedPage page = writer.getImportedPage(reader, i);
   PdfContentByte cb = writer.getDirectContent();
   cb.addTemplate(page,0,0); // Add temp pdf to the real pdf
try {
pdf.newPage();
   } catch (Exception e) {
System.err.println("Error starting new page");
   }
  }

 } catch (IOException e) {
  System.err.println("Couldn't open rendertemp.pdf!");
 }



Just for fun I tried to open an existing pdf that I didn't generate myself,
instead of rendertemp.pdf. That worked fine. I then renamed the temp pdf and
tried to append it, and that worked as well. It seems like if I generate my
temp pdf, close it, then import it into my real pdf right away, it doesn't
work.

Is there something more I have to do other than tempPdf.close() before I try
and open it?


--
Ben Sinclair
[EMAIL PROTECTED]


- Original Message -
From: "Ben Sinclair" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 13, 2002 12:47 PM
Subject: Re: [iText-questions] ArrayIndexOutOfBoundsException


> I know the PDF is probably totally invalid. Is there any way to make it throw
> an exception indicating this before I call .close()? Since this occurs during
> close(), I don't get anything into my new PDF.
>


___

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



Re: [iText-questions] ArrayIndexOutOfBoundsException

2002-05-13 Thread Ben Sinclair

I know the PDF is probably totally invalid. Is there any way to make it throw
an exception indicating this before I call .close()? Since this occurs during
close(), I don't get anything into my new PDF.

--
Ben Sinclair
[EMAIL PROTECTED]

- Original Message -
From: "Paulo Soares" <[EMAIL PROTECTED]>

> A pdf validator is a most wanted tool but up to now the only way is to
> import the pdf into acrobat or gs and see what happens. If the pdf opens ok
> in these two readers it may be a problem with iText. In that case send me
> the pdf for examination.



___

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



RE: [iText-questions] ArrayIndexOutOfBoundsException

2002-05-13 Thread Leonard Rosenthol

At 5:21 PM +0100 5/13/02, Paulo Soares wrote:
>A pdf validator is a most wanted tool but up to now the only way is to
>import the pdf into acrobat or gs and see what happens.

I have a hacked version of Xpdf that will do this - report 
all sorts of problems with PDF's that you feed it.  However, you 
should also know that there are PDF's that Xpdf will report as 
"undamaged" that iText can't (currently) handle due to the way the 
PdfReader is structured.


Leonard
-- 
---
Leonard Rosenthol
Chief Technical Officer  
PDF Sages, Inc.  215-629-3700 (voice)


___

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



RE: [iText-questions] ArrayIndexOutOfBoundsException

2002-05-13 Thread Paulo Soares

A pdf validator is a most wanted tool but up to now the only way is to
import the pdf into acrobat or gs and see what happens. If the pdf opens ok
in these two readers it may be a problem with iText. In that case send me
the pdf for examination.

Best Regards,
Paulo Soares

> -Original Message-
> From: Ben Sinclair [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, May 13, 2002 16:31
> To:   [EMAIL PROTECTED]
> Subject:  Re: [iText-questions] ArrayIndexOutOfBoundsException
> 
> Is there a way to tell if the pdf is defective before I try and import it?
> 
> --
> Ben Sinclair
> [EMAIL PROTECTED]
> 
> - Original Message -
> From: "Paulo Soares" <[EMAIL PROTECTED]>
> To: "'Ben Sinclair'" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Tuesday, May 07, 2002 11:13 AM
> Subject: RE: [iText-questions] ArrayIndexOutOfBoundsException
> 
> 
> > Probably the imported pdf is defective or there's some file access
> error.
> > This error only depends on the imported pdf.
> 
> 
> 
> ___
> 
> Have big pipes? SourceForge.net is looking for download mirrors. We supply
> the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
> ___
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions

___

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



Re: [iText-questions] ArrayIndexOutOfBoundsException

2002-05-13 Thread Ben Sinclair

Is there a way to tell if the pdf is defective before I try and import it?

--
Ben Sinclair
[EMAIL PROTECTED]

- Original Message -
From: "Paulo Soares" <[EMAIL PROTECTED]>
To: "'Ben Sinclair'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, May 07, 2002 11:13 AM
Subject: RE: [iText-questions] ArrayIndexOutOfBoundsException


> Probably the imported pdf is defective or there's some file access error.
> This error only depends on the imported pdf.



___

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



RE: [iText-questions] ArrayIndexOutOfBoundsException

2002-05-07 Thread Paulo Soares

Probably the imported pdf is defective or there's some file access error.
This error only depends on the imported pdf.

Best Regards,
Paulo Soares

> -Original Message-
> From: Ben Sinclair [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, May 07, 2002 17:03
> To:   [EMAIL PROTECTED]
> Subject:      [iText-questions] ArrayIndexOutOfBoundsException
> 
> Any idea what might cause this? I'm doing so many strange things to my
> PDFs
> that I'm not sure a code sample would help.
> 
> Exception occurred during event dispatching:
> java.lang.ArrayIndexOutOfBoundsException
>  at java.lang.System.arraycopy(Native Method)
>  at java.io.BufferedOutputStream.write(BufferedOutputStream.java:118)
>  at com.lowagie.text.pdf.PRStream.writeTo(PRStream.java:160)
>  at
> com.lowagie.text.pdf.PdfIndirectObject.writeTo(PdfIndirectObject.java:183)
>  at com.lowagie.text.pdf.PdfWriter.addToBody(PdfWriter.java:1229)
>  at
> com.lowagie.text.pdf.PdfReaderInstance.writeAllPages(PdfReaderInstance.jav
> a:204
> )
>  at com.lowagie.text.pdf.PdfWriter.close(PdfWriter.java:734)
>  at com.lowagie.text.pdf.PdfDocument.close(PdfDocument.java:924)
>  at com.lowagie.text.Document.close(Document.java:492)
>  at benproject.document.pdf.PDFRenderer.render(PDFRenderer.java:269)
> 
> --
> Ben Sinclair
> [EMAIL PROTECTED]
> 
> 
> ___
> 
> Have big pipes? SourceForge.net is looking for download mirrors. We supply
> the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
> ___
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions

___

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



[iText-questions] ArrayIndexOutOfBoundsException

2002-05-07 Thread Ben Sinclair

Any idea what might cause this? I'm doing so many strange things to my PDFs
that I'm not sure a code sample would help.

Exception occurred during event dispatching:
java.lang.ArrayIndexOutOfBoundsException
 at java.lang.System.arraycopy(Native Method)
 at java.io.BufferedOutputStream.write(BufferedOutputStream.java:118)
 at com.lowagie.text.pdf.PRStream.writeTo(PRStream.java:160)
 at com.lowagie.text.pdf.PdfIndirectObject.writeTo(PdfIndirectObject.java:183)
 at com.lowagie.text.pdf.PdfWriter.addToBody(PdfWriter.java:1229)
 at
com.lowagie.text.pdf.PdfReaderInstance.writeAllPages(PdfReaderInstance.java:204
)
 at com.lowagie.text.pdf.PdfWriter.close(PdfWriter.java:734)
 at com.lowagie.text.pdf.PdfDocument.close(PdfDocument.java:924)
 at com.lowagie.text.Document.close(Document.java:492)
 at benproject.document.pdf.PDFRenderer.render(PDFRenderer.java:269)

--
Ben Sinclair
[EMAIL PROTECTED]


___

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions