itextsharp 中的文本正确格式和对齐方式

Text Proper Formatting and alignment in itextsharp

我正在使用此代码在 table

中将两个 phrases/two 列对齐在一起
        table = new PdfPTable(2);
        table.TotalWidth = 450f;
        table.LockedWidth = true;
        float[] widths= new float[] { 100f, 350f };
        table.SetWidths(widths);
        table.WidthPercentage = 85;
        table.HorizontalAlignment = Element.ALIGN_LEFT;
        cell = new PdfPCell();
        cell = PhraseCell(new Phrase("Repair 2 - Tongue pig biltong picanha:", newfntbld), PdfPCell.ALIGN_LEFT);
        cell.PaddingTop = 12f;
        table.AddCell(cell);
        cell = PhraseCell(new Phrase("Ham beef ball tip, pastrami sausage ribeye meatloaf salami kielbasa. Ground round bresaola pastrami ham capicola pork belly, tri-tip drumstick. Beef hamburger pork loin bacon doner chuck shank strip steak ham hock meatloaf. Flank meatball swine frankfurter.", newlightfnt), PdfPCell.ALIGN_LEFT);
        cell.PaddingTop = 12f;
        cell.Border = 0;
        table.AddCell(cell);       

我得到这个作为结果

但我想这样显示:

表格通常不会为您提供那种布局。你为什么要把它硬塞进 table?

将其构建为一个段落要容易得多:

Phrase phrase1 = new Phrase("Repair 2 - Tongue pig biltong picanha - ", newfntbld);
Phrase phrase2 = new Phrase("Ham beef ball tip, pastrami sausage ribeye meatloaf salami kielbasa. Ground round bresaola pastrami ham capicola pork belly, tri-tip drumstick. Beef hamburger pork loin bacon doner chuck shank strip steak ham hock meatloaf. Flank meatball swine frankfurter.", newlightfnt);
Paragraph para = new Paragraph();
para.Add(phrase1);
para.Add(phrase2);