iTextSharp Adding Text plus Barcode in a single cell?

前端 未结 1 1970
感动是毒
感动是毒 2021-01-19 10:00

Basically, I want to combine a string with a barcode into a single cell using iTextSharp. From the code below it is the following two lines:

 table.AddCell(         


        
相关标签:
1条回答
  • 2021-01-19 10:43

    Rather simple actually...

    PdfPCell cell = new PdfPCell( table.DefaultCell /* optional */ );
    cell.AddElement( tempString );
    cell.AddElement(new text.Phrase(new text.Chunk(image39, 0, 0)));
    table.AddCell(cell);
    

    try a few variations of that...you may have to experement a little, such as this

    PdfPCell cell = new PdfPCell( table.DefaultCell /* optional */ );
    Phrase phrase = new Phrase();
    phrase.Add(new Chunk(tempString));
    phrase.Add(new Chunk(image39, 0, 0)));
    cell.AddElement( phrase );
    table.AddCell(cell);
    
    0 讨论(0)
提交回复
热议问题