Ahmet Kilic wrote
> I am newbie. I searched on the the forum but I could not found the answer.
> My problem is;
> I can save barcode as an image but I want to show also the barcode
> numbers on the picture.
> How can I do it?
>
>
> My code is;
>
> package barcode;
>
> import java.awt.*;
> import java.awt.image.*;
> import java.io.*;
> import javax.imageio.*;
> import com.lowagie.text.pdf.BarcodeEAN;
>
> public class ImgTest {
>
> public static void main(String[] args) throws Exception
> {
> BarcodeEAN codeEAN = new BarcodeEAN();
> codeEAN.setCodeType(codeEAN.EAN13);
> codeEAN.setCode("4902555131719");
> // String value = codeEAN.getCode();
> // System.out.println(value); // I want to show this
> code on the picture
> // codeEAN.setAltText(value);
> Image image = codeEAN.createAwtImage(Color.black, Color.white);
>
> BufferedImage bffImg
> = new
> BufferedImage(image.getWidth(null),image.getHeight(null),
> BufferedImage.TYPE_3BYTE_BGR);
> Graphics offg = bffImg.createGraphics();
> offg.drawImage(image, 0, 0, null);
>
> ImageIO.write(bffImg, "jpeg", new File("test.jpg"));
> }
> }
>
> please help me..
is it about the image setting problem ? or you may refer to the guide of
java barcode generator
<http://www.keepautomation.com/guide/java_barcode_generator.html> if you
got sth. wrong while generating
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/create-barcode-as-an-image-tp2169777p4659095.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
[email protected]
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