3
Answers

How to change Pdf page orientation portrait to landscape c#

I used this code
 
iTextSharp.text.Document pdfdoc = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4.Rotate(), 12f, 12f, 12f, 12f);
 
still in portrait mode?
 
Plz share your answer.

Answers (3)

2
Photo of alice yang
NA 722 117 8y
Hello,
 
You can also use Free Spire.PDF(https://www.e-iceblue.com/Introduce/free-pdf-component.html) to achieve the same task.
 
Refer to below link:
https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Page-Setting/How-to-rotate-the-PDF-file-in-C.html  
Accepted
1
Photo of Mohamed Abedallah
NA 852 142 8y
According to the following dissection this issue seems to be working using iTextSharp v4.1:
http://stackoverflow.com/questions/10040161/itextsharp-landscape-document
 
Alternatively, you can take a look at LEADTOOLS Rotate functions to rotate your PDF file.
https://www.leadtools.com/help/leadtools/v19/dh/l/leadtools~leadtools.imageprocessing.rotatecommand.html
 
Disclaimer: I work for the company that created this library.
0
Photo of Satyaprakash Samantaray
56 29.2k 10.3m 8y
Thanks guys for answering my query.