以有组织和结构化的方式显示PDF格式的数据

时间:2019-02-17 07:13:45

标签: c# itext

我正在使用C#为一所学校创建费用凭证,而我遇到的主要问题是如何以有组织的方式在PDF上显示数据:

Name: Student Name Name: Student Name Name:Student Name A/C#: 12345 A/C#: 12345 A/C#:12345 当我运行程序时,这就是数据在PDF中的显示方式:

Name: Student Name Name: Student Name Name:Student Name A/C#:12345 A/C#:12345 A/C#:12345

  1. 我尝试使用padleft()属性,但结果相同。

  2. 我也尝试了以下代码,但没有一个满足我的要求。

    Document doc = new Document(iTextSharp.text.PageSize.A3.Rotate());
    PdfWriter wri = PdfWriter.GetInstance(doc, new FileStream("Test.pdf", FileMode.Create));
    doc.Open();
    Paragraph para = new Paragraph($" {"Name:",-17} {"Faheel Mohammad"}"+ $" {"",-43} {""}"+ $" {"Name:",-17} {"Faheel Mohammad"}" + $" {"",-43} {""}" + $" {"Name:",-17} {"Faheel Mohammad"}");
    Paragraph para2 = new Paragraph($" {"A/C #",-17} {"12345"}" + $" {"",-43} {""}" + $" {"A/C #",-17} {"12345"}" + $" {"",-43} {""}" + $" {"A/C #",-17} {"12345"}");
    

有人可以帮助我实现我所需要的吗?

0 个答案:

没有答案