【问题标题】:how to rotate pdf using itextsharp library如何使用 itextsharp 库旋转 pdf
【发布时间】:2011-06-14 11:02:34
【问题描述】:

嗨 我们如何使用 itext 库旋转 PDF。 谢谢

【问题讨论】:

标签: c# pdf itext rotation


【解决方案1】:

这是一个非常简单的例子:

Document pdf = new Document(PageSize.A4);
PdfWriter.GetInstance(pdf, new FileStream("file.pdf", System.IO.FileMode.Create));
pdf.Open();
pdf.Add(new Paragraph("This is a pdf document!"));
pdf.Close();

编辑:我的错误,我阅读了“如何创建 pdf ...”。这就是上面的例子所做的。对不起。

【讨论】:

    【解决方案2】:

    如果您写入一个新的 PDF 文档,以下行将创建一个新的 A4 页面旋转(变成横向)

    Document doc = new Document(PageSize.A4.Rotate());
    

    【讨论】:

      猜你喜欢
      • 2023-04-01
      • 2011-04-04
      • 2022-01-14
      • 1970-01-01
      • 2014-09-29
      • 1970-01-01
      • 2018-02-14
      相关资源
      最近更新 更多