如何使用ASP.NET与C#在pdf中对齐表格中心? [英] How to align table center in the pdf using ASP.NET with C#?

查看:106
本文介绍了如何使用ASP.NET与C#在pdf中对齐表格中心?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用带有c#的asp.net在pdf中对齐表格中心。我正在使用stringbuilder并将值附加到具有内联样式的表,同时使用itextsharp将html页面中的内容导出到pdf。但桌子已经完全伸展了。



我尝试过的事情:



以下是我的代码:

I want to align table center in the pdf using asp.net with c#. I am using stringbuilder and appending the values to a table with inline style while exporting contents in html page to pdf using itextsharp. But the table is coming fully stretched.

What I have tried:

Below is my code:

   sb.Append("<table border=1 align='center' style='width:500px;text-align:center'>");
                    sb.Append("<tr>");
                    sb.Append("<td align='left' style='font-size:12pt;float:right;'>Cheque Number</td>");
                    sb.Append("<td align='left' style='font-size:12pt;float:right;'>Date</td>");
                    sb.Append("<td align='left' style='font-size:12pt;float:right;'>Drawee Bank</td>");
                    sb.Append("<td align='left' style='font-size:12pt;float:right;'>Return Reason</td>");
                    sb.Append("<td align='left' style='font-size:12pt;float:right;'>Amount</td>");
                    sb.Append("</tr>");
<pre>    sb.Append("</table>");

推荐答案

你可以使用itextSharp第三部分DLL并使用它的对象你可以对齐表格

可以在下方可以提供帮助。



使用C#和iTextSharp在PDF中创建表格[ ^ ]
You can use the itextSharp third part DLL and using it's object you can align table
Might be below can help.

Create Table In PDF using C# And iTextSharp[^]


这篇关于如何使用ASP.NET与C#在pdf中对齐表格中心?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆