You have sent the same query four times to the mailing list... Stop hitting 
that button :)

PDF417 with alphanumeric content (which base64 hopefully is) has a max of 1800 
bytes. Either you find a way to compact your text (before or after encoding)
Or you use a different 2D barcode.

QR has > 4000 alphanum chars
Aztech  3000 chars
Codablock F 2725 chars
Datamatrix 2300 chars

I think at least QR is supported by iText, but check yourself.

/Gerold

Von: Eduardo Pindado [mailto:edu_p...@hotmail.com]
Gesendet: Freitag, 15. Februar 2013 12:24
An: itext-questions@lists.sourceforge.net
Betreff: [iText-questions] Encoding base64 in Barcode

I'm trying to generate a PDF with digital signature. After getting it, I wanted 
to add the signature information in base64 to a barcode, but i don't know what 
code type have to use. I tested with BarcodePDF417 but I get this error:

Exception in thread "main" java.lang.IndexOutOfBoundsException: The text is too 
big.
at com.lowagie.text.pdf.BarcodePDF417.textCompaction (BarcodePDF417.java: 359)
at com.lowagie.text.pdf.BarcodePDF417.assemble (BarcodePDF417.java: 604)
at com.lowagie.text.pdf.BarcodePDF417.paintCode (BarcodePDF417.java: 675)
at com.lowagie.text.pdf.BarcodePDF417.getImage (BarcodePDF417.java: 772)
at firmaPDF.insertaBarCode (firmaPDF.java: 169)
at firmaPDF.main (firmaPDF.java: 61)

The sign has between 1800 and 3000 characters, minimum and maximum. This is the 
code I have:
......
PdfReader reader = null;
PdfStamper stamper = null;
         try {
             reader = new PdfReader (rutaEntrada);
             stamper = new PdfStamper (reader, new FileOutputStream 
(rutaSalida));

            int maxPagina = reader.getNumberOfPages();
             PdfContentByte underContent = stamper.getUnderContent (maxPagina);

             / / Insert barcode
             BarcodePDF417 BarcodePDF417 codePDF417 = new ();
             codePDF417.setText (deskSign.getString ());
             Image imageEAN codePDF417.getImage = ();
             imageEAN.setAbsolutePosition (100f, 10f);
             underContent.addImage (imageEAN);

         } Catch .....

Do i have to define something more? Or should I use other encodings?

thanks
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
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

Reply via email to