【问题标题】:C# - Using the opened Pdf with Pdf readerC# - 将打开的 Pdf 与 Pdf 阅读器一起使用
【发布时间】:2012-11-29 09:22:27
【问题描述】:

我正在使用

 axAcroPDF1.LoadFile(path);

现在要在容器中加载 pdf,我在同一个类中声明了另一个函数,并且我正在使用 itextsharp 来读取我使用的这个

 PdfReader reader = new PdfReader();

并且 () 内部没有传递任何内容我如何确保 PdfReader 仅使用打开的 Pdf。

【问题讨论】:

    标签: c# visual-studio-2010 c#-4.0 itextsharp


    【解决方案1】:

    AFAIK 在 PdfReader 类中没有无参数构造函数。您应该为它提供文件、流或字节的路径:

            const string pdfFilename = "/path/to/pdf/filename.pdf";
            PdfReader reader = new PdfReader(pdfFilename);
    

    【讨论】:

    • 但由于我已将 pdf 加载到容器中,是否可以读取相同的内容而不是指定整个路径
    • 您能否指定哪个(类型?)容器是“axAcroPDF1”?也许你可以从中获取字节?
    猜你喜欢
    • 1970-01-01
    • 2014-09-04
    • 1970-01-01
    • 1970-01-01
    • 2013-11-24
    • 2017-05-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多