PdfPTable单元格宽度

Ces*_*uel 1 c# asp.net-mvc itextsharp asp.net-mvc-4

我正在使用iTextSharp我的应用程序创建PDF.但是我必须重新创建一个表,我必须为一个非常小的列设置大小.下面是显示我想要设置列的大小的图片: 在此输入图像描述

当表创建的其余部分都很好时,我无法设置此宽度.

码:

PdfPTable table = new PdfPTable(2);
table.WidthPercentage = 82.0f;
PdfPCell cell = new PdfPCell(new Phrase("Com a assinatura autógrafa, o signatário desta Auto-declaração garante ter cumprido estas condições:", fontetexto));
cell.PaddingBottom = 10f;
cell.PaddingTop = 10f;
cell.Colspan = 2;
cell.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right
table.AddCell(cell);
table.AddCell("1. ");
table.AddCell("Os óleos e gorduras vegetais velhos fornecidos são biomassa conforme o Decreto de biomassa.");
Run Code Online (Sandbox Code Playgroud)

Ran*_*iri 5

尝试使用此代码

PdfPTable table =  new PdfPTable(new float[] { 30f, 400f });
table.HorizontalAlignment = 0;
table.TotalWidth = 500f;
table.LockedWidth = true;
table.SetWidths(widths);
Run Code Online (Sandbox Code Playgroud)