开发者

how to rotate pdf using itextsharp library

hi ho开发者_如何学Gow do we rotate PDF using itext library. Thanks


If you writing to a new PDF document, the following line will create a new A4 page rotated (into landscape)

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


This is a very simple example:

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();

Edit: My mistake, I read "how to create pdf ...". That is what the example above does. I am sorry.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜