Maybe those characters don't exist in the font or are invisible. If that's a code128 font you'll also need to calculate the checksum and put another character or characters, it's quite complex. I don't see how this is an iText related problem.
Paulo ----- Original Message ----- From: "Claudia Murialdo" <[email protected]> To: <[email protected]> Sent: Wednesday, December 23, 2009 1:54 PM Subject: [iText-questions] Barcode128 PDF start and stop characters don´t appear > Hello, > I'm using itext to generate a PDF document with a BarCode128. The problem > is that the start and stop characters (characters 135 and 138) are not > printed. It works fine if I do it using iTextSharp.text.pdf.Barcode128 > instead of PdfContentByte using the true type font. > This is the code: > > public static void Main(String[] args) > { > Rectangle pageSize = new Rectangle(780, 525); > Document document = new Document(pageSize); > > PdfWriter writer = PdfWriter.GetInstance(document, > File.OpenWrite("Test.pdf")); > document.Open(); > > PdfContentByte cb = writer.DirectContent; > BaseFont bf = BaseFont.CreateFont(@"C:\WINDOWS\Fonts\Bcode128.ttf", > BaseFont.IDENTITY_H, BaseFont.EMBEDDED); > cb.SetFontAndSize(bf, 50); > cb.BeginText(); > cb.ShowTextAligned(Element.ALIGN_CENTER, "‡BARCODE7Š", 200, 350, > 0f); //Character ‡ and Š don't appear in the generated PDF document > > cb.EndText(); > > document.Close(); > } > > I tried with the unicode numbers (I tried with this string: > "\u01c2BARCODE7\u0160") but it is the same. > Also, bf.CharExists('‡') returns false, and the same for > bf.CharExists('Š'). I guess it is related with the problem. > > How can I get those start and stop characters printed using > PdfContentByte?. > Thanks in advance. > Claudia. > ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
