Reputation: 95
Below is my code to create custom page size in ItextSharp. Page is now printing in landscape mode. I want print in Portrait.
document = new Document(new iTextSharp.text.Rectangle(410f, 288f));
Upvotes: 1
Views: 1672
Reputation: 2111
Document document = new Document(default(iTextSharp.text.Rectangle));
document.SetPageSize(new iTextSharp.text.Rectangle(410f, 288f).Rotate());
please try this.
Upvotes: 0
Reputation: 77528
Replace:
document = new Document(new iTextSharp.text.Rectangle(410f, 288f));
With:
document = new Document(new iTextSharp.text.Rectangle(410f, 288f).Rotate());
And the custom page will be rotated by 90 degrees, if that's what you want.
Upvotes: 1