本文介绍了PdfPTable单元格的宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用 iTextSharp的以创建在我的应用程序的PDF文件。不过,我必须重新创建一个表,在这里我必须设置大小非常小柱。下面是显示我要设置列大小的图片:
在创建表的所有剩下的就是不好,我不能设置宽度
code:
PdfPTable表=新PdfPTable(2);table.WidthPercentage = 82.0f;PdfPCell电池=新PdfPCell(新词(COM之间assinaturaautógrafa,邻signatário德斯塔自动declaraçãogarante之三cumprido estascondições:fontetexto));cell.PaddingBottom = 10F;cell.PaddingTop = 10F;cell.Colspan = 2;cell.HorizontalAlignment = 1; // 0 =左1 =中心2 =右table.AddCell(细胞);table.AddCell(1);table.AddCell(OSóleosêgorduras vegetais velhos fornecidos圣保罗biomassa CONFORMEØDecreto德biomassa。);解决方案
尝试用这个code
PdfPTable表=新PdfPTable(新浮法[] {30F,400F});table.HorizontalAlignment = 0;table.TotalWidth = 500F;table.LockedWidth = TRUE;table.SetWidths(宽度);I'm using iTextSharp to create PDFs in my application. However I have to recreate a table, where I have to set the size for a very small column. Below is the picture that shows the size I want to set the column:
When the rest of the table creation all is well, I can't set this width.
Code:
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.");解决方案
try with this code
PdfPTable table = new PdfPTable(new float[] { 30f, 400f }); table.HorizontalAlignment = 0; table.TotalWidth = 500f; table.LockedWidth = true; table.SetWidths(widths);
更多推荐
PdfPTable单元格的宽度
发布评论