如何在itextsharp中将自定义页面尺寸打印为纵向 [英] How to print custom page size as portrait in itextsharp

查看:250
本文介绍了如何在itextsharp中将自定义页面尺寸打印为纵向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的代码,用于在ItextSharp中创建自定义页面大小. 现在正在以横向模式打印页面.我要以纵向打印.

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

推荐答案

替换:

document = new Document(new iTextSharp.text.Rectangle(410f, 288f));

使用:

document = new Document(new iTextSharp.text.Rectangle(410f, 288f).Rotate());

如果需要的话,自定义页面将旋转90度.

And the custom page will be rotated by 90 degrees, if that's what you want.

这篇关于如何在itextsharp中将自定义页面尺寸打印为纵向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆