如何更改PDF Gembox中页面的大小

发布于 2025-01-29 22:49:04 字数 626 浏览 2 评论 0原文

我正在尝试使用gemboxpdf从划痕创建PDF,

  using (var document = new PdfDocument())
        {
            // Add a page.
            var page = document.Pages.Add();
            page.Rotate = 90;
            // Write a text.
            using (var formattedText = new PdfFormattedText())
            {
                formattedText.Append("Hello World!");

                page.Content.DrawText(formattedText, new PdfPoint(100, 700));
            }}

我想更改页面的大小,以便能够将其设置为A1,A2,A3或A4或自定义大小,

我尝试设置Cropbox,但是它不起作用。 我已经看到了如何使用spreedsheet进行操作的另一个问题,但是使用其printOptions我也无法更改其大小

如何修改页面尺寸?

谢谢

I'm trying to create a PDF from the scratch using GemBoxPdf

  using (var document = new PdfDocument())
        {
            // Add a page.
            var page = document.Pages.Add();
            page.Rotate = 90;
            // Write a text.
            using (var formattedText = new PdfFormattedText())
            {
                formattedText.Append("Hello World!");

                page.Content.DrawText(formattedText, new PdfPoint(100, 700));
            }}

I'd like to change the size of the page to be able to set it as A1,A2,A3 or A4 or custom size

I've tried to set the cropBox but it does not work.
I've seen another questions of how to do it with spreedsheet but using its PrintOptions I am also unable to change its size

How do I modify the page size ?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文