3
テーブルを備えたPDF文書があります。次されているコード:iText 7を使用して、セル内の画像を囲むテキストを囲みます。
PdfWriter _writer = new PdfWriter(@"C:\output.pdf");
PdfDocument _document = new PdfDocument(_writer);
Document MyDocument = new Document(_document, PageSize.A4);
Table MyTable = new Table(new float[] { 1, 4 });
MyTable.SetWidthPercent(100);
MyTable.AddHeaderCell(new Cell().Add(new Paragraph("ID")));
MyTable.AddHeaderCell(new Cell().Add(new Paragraph("Description")));
MyTable.AddCell(new Cell().Add(new Paragraph("1")));
Cell descCell = new Cell();
descCell.Add(IMG); // iText.Layout.Element.Image
descCell.Add(new Paragraph("This is the description."));
MyTable.AddCell(descCell);
MyDocument.Add(MyTable);
MyDocument.Close();
は、実際に出力がこれです:私が達成しようとしています何
これです:
私はいくつかの試験を読んだiText 5のplesとこのプロパティを使用するすべてのポイント:
image.setAlignment(Image.LEFT | Image.TEXTWRAP);
問題は、任意の助けをいただければ幸いですiTextの7
にavaliableであるように思わないことです。
浮動イメージは現在iText7ではサポートされていませんが、ロードマップ上にあります。 –