如何将数据从网页插入pdf文件的字段? [英] how to insert the data to fields of pdf file from a web page ?

查看:90
本文介绍了如何将数据从网页插入pdf文件的字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有一个pdf文件,里面有一些字段。我想把数据插入网页的那些字段....请你帮我吧?????



你们有没有人告诉我代码.....

hi everyone, i have a pdf file having some fields.I want to insert the data into those fields from the web page....will u plz help me?????

will u anyone tell me the code .....

推荐答案

tanq mr.manak chand for ur suggestion我已成功执行此处是我的代码

protected void btn_Click(object sender,EventArgs e)

{

string path =sourse path;

PdfReader rdr = new PdfReader(source path);

PdfStamper stamper = new PdfStamper(rdr,new System.IO.FileStream(destination path,System.IO.FileMode。创建));

stamper.AcroFields.SetField(softwarename,txtSoftware.Text);

stamper.AcroFields.SetField(softwaretype,txtSoftwaretype.Text);

stamper.AcroFields.SetField(license,textLicense.Text);

stamper.AcroFields.SetField(category, cbCategory.Text);

// foreach(lbPlatform.SelectedItems中的字符串项)平台+ = item +,;

stamper.AcroFields.SetField(platforms,platforms.Text) ;

stamper.Close();

rdr.Close();

display.Text =pdf生成成功;

System.Diagnostics.Process.Start(路径);

}
tanq mr.manak chand for ur suggestion i have successfully executes here is my code
protected void btn_Click(object sender, EventArgs e)
{
string path = "sourse path";
PdfReader rdr = new PdfReader("source path");
PdfStamper stamper = new PdfStamper(rdr, new System.IO.FileStream("destination path" , System.IO.FileMode.Create));
stamper.AcroFields.SetField("softwarename", txtSoftware.Text);
stamper.AcroFields.SetField("softwaretype", txtSoftwaretype.Text);
stamper.AcroFields.SetField("license", textLicense.Text);
stamper.AcroFields.SetField("category", cbCategory.Text);
//foreach (string item in lbPlatform.SelectedItems) platforms += item + ", ";
stamper.AcroFields.SetField("platforms", platforms.Text);
stamper.Close();
rdr.Close();
display.Text="pdf generated successfully";
System.Diagnostics.Process.Start(path);
}


这篇关于如何将数据从网页插入pdf文件的字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆