如何识别Aspose PDF中的页面溢出

发布于 2025-02-02 19:57:31 字数 592 浏览 3 评论 0原文

我正在使用Aspose .NET API将HTML内容转换为PDF。 HTML内容包含具有动态数据的表,因此,如果数据是更多日期,则表将溢出到第二页。

是否有一种方法可以识别文档中的页面溢出,因为每当发生溢出时,我都希望在两者之间插入一个空页面。

代码片段:

// Creating Doc
 Aspose.Pdf.Document document = new Document();
for(var contentModel in listcontentModel)
{
 Page page = document.Pages.Add();
string HTMLContent = //HTMLContent -- using contentModel to build HTML;
-- Sometime page overflow happens because of huge HTML content
HtmlFragment printHtml = new HtmlFragment(text);
page.Paragraphs.Add(printHtml);
}
document.Save(filePath);

预先感谢。

I am converting a HTML content to PDF using Aspose .Net API's. HTML content contains table which has dynamic data, so if the data is more date, then the table is overflown into second page.

Is there a way to Identify the page overflown in my document, because I want insert an empty page in between, whenever an overflow happens.

Code Snippet:

// Creating Doc
 Aspose.Pdf.Document document = new Document();
for(var contentModel in listcontentModel)
{
 Page page = document.Pages.Add();
string HTMLContent = //HTMLContent -- using contentModel to build HTML;
-- Sometime page overflow happens because of huge HTML content
HtmlFragment printHtml = new HtmlFragment(text);
page.Paragraphs.Add(printHtml);
}
document.Save(filePath);

Thanks in Advance.

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

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

发布评论

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