iTextSharp dll을 사용하여 바코드 이미지 아래에 텍스트를 직접 표시하는 방법은 없습니다. 나는 똑같은 시도하고 텍스트를 표시하는 해결 방법을했다. 이것은 직접적인 해결책은 아니지만 바코드 이미지에서 예상되는 것과 유사한 출력을 제공합니다.
바코드 이미지를 생성하기 위해 나는 그의 블로그에서 JP Hellemons가 공유 한 입력을 사용했습니다. 감사 JP Hellemons! http://www.jphellemons.nl/post/Make-a-code128-barcode-with-C-sharp-and-iTextSharp.aspx
내가 사용하는 코드 : 내가 잘못했다 경우
Barcode128 code128 = new Barcode128();
code128.CodeType = iTextSharp.text.pdf.Barcode.CODE128;
code128.ChecksumText = true;
code128.GenerateChecksum = true;
code128.StartStopText = false;
code128.Code = <<Barcode value>>;
// Create a blank image
System.Drawing.Bitmap bmpimg = new Bitmap(120,35); // provide width and height based on the barcode image to be generated. harcoded for sample purpose
Graphics bmpgraphics = Graphics.FromImage(bmpimg);
bmpgraphics.Clear(Color.White); // Provide this, else the background will be black by default
// generate the code128 barcode
bmpgraphics.DrawImage(code128.CreateDrawingImage(System.Drawing.Color.Black, System.Drawing.Color.White), new Point(0, 0));
//generate the text below the barcode image. If you want the placement to be dynamic, calculate the point based on size of the image
bmpgraphics.DrawString(<<Barcode value>>, new System.Drawing.Font("Arial", 8, FontStyle.Regular), SystemBrushes.WindowText, new Point(15, 24));
// Save the output stream as gif. You can also save it to external file
bmpimg.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif);
이 정정 해줘 ..
너희 중에 누구든지 직접 또는 간단한 해결책이있는 경우, 공유하시기 바랍니다 ..
[this] (http://stackoverflow.com/questions/3215522/itextsharp-adding-text-plus-barcode-in-a-single-cell) help? –