【问题标题】:How to get the remaining page size using syncfusion pdf如何使用syncfusion pdf获取剩余页面大小
【发布时间】:2019-08-26 20:20:17
【问题描述】:

我正在使用 xamarin 表单的 synfusion pdf 插件创建 pdf,如果我打印我的 pdf 会发生什么,那么页面上有很多剩余空间,所以我如何使用 syncfusion pdf 获得 pdf 页面的剩余空间

【问题讨论】:

  • 您想在剩余空间中显示什么?
  • 我希望下一个问题从下一页开始目前下一个问题是从这个空白空间开始我只想通过代码获取剩余空间

标签: c# xamarin xamarin.forms syncfusion


【解决方案1】:

我们可以使用PdfLayoutResult获取PDF文档页面中的空白区域。详情请参考以下代码sn-p,

C#:

//Create a text element with the text and font
PdfTextElement textElement = new PdfTextElement(text, font);
PdfLayoutFormat layoutFormat = new PdfLayoutFormat();
layoutFormat.Layout = PdfLayoutType.Paginate;

//Draw the paragraph
PdfLayoutResult result = textElement.Draw(page, new RectangleF(0, 0, 
page.GetClientSize().Width, page.GetClientSize().Height), layoutFormat);

//Get the blank space of PDF using PdfLayoutResult and page height 
float blankSpaceHeight = page.GetClientSize().Height - result.Bounds.Bottom;

我们已经创建了相同的示例,可以从下面的链接下载,

Sample to get the remaining page size of PDF document

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-11-02
    • 1970-01-01
    • 2018-02-24
    • 2020-06-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多