我有这个例子以编程方式填充 FDF 并将其可视化。
private readonly string pdfFormFileName = "PDFForm.pdf";
protected void OpenPDF_Click(object sender, EventArgs e)
{
Response.Clear();
Response.ContentType = "application/vnd.fdf";
FdfWriter fdfWriter = new FdfWriter();
fdfWriter.File = GetAbsolutePath() + pdfFormFileName;
fdfWriter.SetFieldAsName("txtFirstName", FirstName.Text);
fdfWriter.SetFieldAsName("txtLastName", LastName.Text);
Response.AddHeader("Content-disposition", "inline; filename=FlatPDFForm.fdf");
fdfWriter.WriteTo(Response.OutputStream);
Response.End();
}
我需要将其保存到文件中,而不是显示文件。
你能帮帮我吗?