Spire.Barcode is a professional barcode library specially designed for .NET developers (C#, VB.NET, ASP.NET, .NET Core) and Java developers (J2SE and J2EE) to generate, read and scan 1D & 2D barcodes.

Mon Dec 02, 2013 12:23 pm

How can i generate bar code on pdf in ASP.net C# . i am getting data from my dataset and want to print the value on PDF

Here is my code my value in dataset is = _dt.Rows[0]["ORDERNUM"]

Code: Select all
 PdfPCell barcode = new PdfPCell(new Phrase("" + datas[0] + " \n ", FontFactory.GetFont(FontFactory.COURIER, 10, iTextSharp.text.Font.NORMAL)));
                barcode.PaddingBottom = 3;
                barcode.BorderWidthLeft = 0;
                barcode.BorderWidthRight = 0;
                barcode.BorderWidthTop = 0;
                barcode.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
                barcode.Colspan = 12;
                table.AddCell(barcode);


can you please answer this

abhishek_bnmu
 
Posts: 3
Joined: Mon Dec 02, 2013 7:33 am

Tue Dec 03, 2013 1:54 am

Hello,

Thanks for your inquiry.
For your needs, please refer to the following code, and to realize this you need to download the Spire.Pdf(http://www.e-iceblue.com/Download/downl ... t-now.html).
Code: Select all
PdfDocument pdfdoc = new PdfDocument();
PdfSection section = pdfdoc.Sections.Add();
PdfPageBase page = section.Pages.Add();
PdfCodabarBarcode barcode = new PdfCodabarBarcode("00:12-3456/7890");
barcode.BarcodeToTextGapHeight = 1f;
barcode.EnableCheckDigit = true;
barcode.ShowCheckDigit = true;
barcode.TextDisplayLocation = TextLocation.Bottom;
barcode.TextColor = Color.Blue;
barcode.Draw(page, new PointF(50, 50));
pdfdoc.SaveToFile(@"..\..\result.pdf");

If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Dec 10, 2013 9:09 am

Hi,

Has your issue been resolved? Could you please give us some feedback if convenience?

If there are any questions, welcome to get it back to us.

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.BarCode

cron