【问题标题】:iText7 C# MultiColumn TextiText7 C# 多列文本
【发布时间】:2016-09-30 02:16:53
【问题描述】:

我正在努力在 IText 7 .NET 中实现跨多个页面的多列文本。如果有人可以在 C# 中提供如何实现这一点的示例,那就太好了。在 iTextSharp 中可用的 ColumnText 在 Itext7 中不再可用。

【问题讨论】:

    标签: c# text itext7


    【解决方案1】:

    请在提问前阅读documentation 或查看the examples

    iText 7 有一个巨大的改进:您可以像不需要列一样创建文档,然后通过添加特定的渲染器来简单地引入列:

    float offSet = 36;
    float columnWidth = (ps.GetWidth() - offSet * 2 + 10) / 3;
    float columnHeight = ps.GetHeight() - offSet * 2;
    //Define column areas
    Rectangle[] columns = new Rectangle[] {
        new Rectangle(offSet - 5, offSet, columnWidth, columnHeight),
        new Rectangle(offSet + columnWidth, offSet, columnWidth, columnHeight),
        new Rectangle(offSet + columnWidth * 2 + 5, offSet, columnWidth, columnHeight)
    };
    document.SetRenderer(new ColumnDocumentRenderer(document, columns));
    

    【讨论】:

      猜你喜欢
      • 2021-04-29
      • 1970-01-01
      • 2020-07-01
      • 2021-11-09
      • 2018-02-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多