【发布时间】:2017-05-28 13:56:14
【问题描述】:
我有一个使用 Adobe 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