如何使用syncfusion pdf获取剩余页面大小
How to get the remaining page size using syncfusion pdf
我正在使用 xamarin 表单的 synfusion pdf 插件创建 pdf,如果我打印我的 pdf 会发生什么,然后页面上还有很多 space,所以我如何获得剩余的 space使用 syncfusion pdf 的 pdf 页面
我们可以通过PdfLayoutResult获取PDF文档页面中的空白space区域。请参考下面的代码片段了解更多详情,
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;
我们已经创建了相同的示例,可以从下面下载 link,
我正在使用 xamarin 表单的 synfusion pdf 插件创建 pdf,如果我打印我的 pdf 会发生什么,然后页面上还有很多 space,所以我如何获得剩余的 space使用 syncfusion pdf 的 pdf 页面
我们可以通过PdfLayoutResult获取PDF文档页面中的空白space区域。请参考下面的代码片段了解更多详情,
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;
我们已经创建了相同的示例,可以从下面下载 link,