【问题标题】:How to display page count in PDF?如何在 PDF 中显示页数?
【发布时间】:2012-04-17 19:41:33
【问题描述】:

我正在使用 ItextSharp 在我的应用程序中创建 Pdf。当用户点击提交时,pdf 会即时生成并显示给用户。我面临的问题是我无法显示该 pdf 中存在的总页数。我使用图像作为页眉,在页脚中再次使用图像,我不想根据要求在页脚中显示页码。所以我想要类似的东西

“总页数:2(该 pdf 中存在的页面)”在我的 pdf 的第一页上。有可能这样做吗?请提出一些建议。

【问题讨论】:

标签: asp.net pdf itextsharp


【解决方案1】:
//Create instance for the PDF reader
                PdfReader pdf_fie = new PdfReader(filepath);
                //read it's pagecount
                page_count = pdf_fie.NumberOfPages;
                //close the file
                pdf_fie.Close();

【讨论】:

    猜你喜欢
    • 2013-02-03
    • 2019-10-16
    • 1970-01-01
    • 2011-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    相关资源
    最近更新 更多