|
iTextSharp Inserting Text as an Image
Message-ID:<1a8ca003-a47b-489f-b469-395150d5be8d@a26g2000yqn.googlegroups.com>
Subject:iTextSharp - Inserting Text as an Image
Date:Sat, 29 Aug 2009 00:14:54 +0100
I'm using iTextSharp to populate a PDF form-field template.
Forgive me if this is a dumb or obvious question, but would it be
possible to convert a string of characters into an image and insert it
into the document using PdfContentByte? For example, below is the code
I'm using to overlay a barcode onto the document:
PdfContentByte cb = stamper.GetUnderContent(1);
Barcode39 code39BCD = new Barcode39();
code39BCD.Code = SOMEVARIABLE;
code39BCD.Size = 0.65f;
code39BCD.BarHeight = 16;
code39BCD.Extended = false;
Image imageCode39 = code39BCD.CreateImageWithBarcode
(cb, null, null);
imageCode39.SetAbsolutePosition(235, 578);
cb.AddImage(imageCode39);
...there is no object I can find equivilent to "Barcode39" which will
take a string and a font and convert that text to a image with
something like "CreateImageWithBarcode".
The reason for inserting a text image rather than using an embedded
font is that I cannot embed any fonts in this particular document.
Thanks in advance.
Message-ID:<49d4a60e-973e-4d9a-9e5c-a696fe32b8ca@j9g2000vbp.googlegroups.com>
Subject:Re: iTextSharp - Inserting Text as an Image
Date:Mon, 21 Sep 2009 18:45:08 +0100
On Sep 4, 3:57=A0pm, "SH" <trash_mail_acco...@web.de> wrote:
> I'm not sure about your Barcode class. What does it do?
iTextSharp includes special Barcode classes:
http://twinzlover.blogspot.com/2008/01/barcode-generation-using-itext.html
The barcodes are inserted as vector graphics (but not as fonts).
|