0

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

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

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

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)
        {
        } 

    }
4

1 回答 1

0

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

于 2017-04-01T08:16:25.777 回答