PdfPTable单元格的宽度

编程入门 行业动态 更新时间:2024-10-10 23:21:04
本文介绍了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.Horizo​​ntalAlignment = 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.Horizo​​ntalAlignment = 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单元格的宽度

本文发布于:2023-11-23 01:06:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1619557.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:宽度   单元格   PdfPTable

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!