【问题标题】:Read Fillable PDF form fields in ASP.NET在 ASP.NET 中读取可填写的 PDF 表单域
【发布时间】:2017-05-28 13:56:14
【问题描述】:

我有一个使用 Adob​​e Acrobat DC 创建的可填写 PDF 表单,我想将此表单提交到 URL:http://localhost:49168/WebForm1.aspx

我正在使用 Aspose.Pdf 库读取我的代码中的 PDF 文件,但每当我尝试读取该文件时,它都会引发异常:“文件格式不正确”。任何人都可以帮助/指导我如何阅读此表单中的字段。

以下是我尝试使用的代码:

protected void Page_Load(object sender, EventArgs e)
    {
        string pdftype = Request.ContentType;
        int pdfocument = Request.ContentLength;
        try
        {
            byte[] pdf = new byte[pdfocument];
            Stream stream = new MemoryStream(pdf);
            Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form(stream);

         //   HttpContext.Request.InputStream.Read(pdf, 0, pdfocument);
            Document doc = new Document(stream);


        }
        catch (Exception ex)
        {
        } 

    }

【问题讨论】:

  • 请您介意分享输入的 PDF 文件,以便我们测试场景并分享我们的发现。该问题似乎是特定于文档的。我叫 Nayyer,是 Aspose 的开发人员传道者。

标签: asp.net pdf adobe fdf aspose.pdf


【解决方案1】:

我解决了使用 HTML 导出格式而不是 FDF 格式的问题,并使用表单集合读取值。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-06-29
    • 2018-07-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多