PDF表单域(FormField)在HTML显示与提交数据到服务器

1.Adobe Arobat Pro等可以编辑表单域,只有几种控件;

 

2.展示PDF,可用PdfObject.js,Chrome自带?

@{
ViewBag.Title = @ViewBag.aaa;
}

<link href="https://pdfobject.com/css/examples.css" rel="stylesheet" />
<script src="https://pdfobject.com/js/pdfobject.min.js"></script>

<h2>@ViewBag.aaa</h2>


<h1>PDFObject Example: Full-browser embed (no selector specified)</h1>
<p>This example uses one line of JavaScript.</p>
<div class="pdfobject-com"><a href="http://pdfobject.com">PDFObject.com</a></div>

<script>
PDFObject.embed("http://files.cnblogs.com/files/yansc/Date31.pdf");
</script>
<!-- analytics, unrelated to any example code presented on this page -->
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-1394306-6', 'auto');
ga('send', 'pageview');
</script>

pdf1

 pdf2

注意BarCode一般根据其他Text控件内容生成

3.服务器端接收提交

[HttpPost]
public int Index(string postData2)
{
Stream postData = Request.InputStream;

StreamReader reader = new StreamReader(postData);
string postContent = reader.ReadToEnd();
reader.Close();

return -1;
}

4.服务器端使用iTextSharp分发PDF文件,修改提交按钮可用状态,展示单条记录

5.服务器端的内容格式:

%FDF-1.2
1 0 obj
<</FDF<</F<</F(http///files.cnblogs.com/files/yansc/Date28.pdf)/Type/Filespec/UF(http///files.cnblogs.com/files/yansc/Date28.pdf)>>/Fields
[<</T(Text1)/V(wwwww)>><</T(accountType)/V/checking>><</T(cbText)/V/Yes>>]>>>>
endobj

trailer
<</Root 1 0 R>>
%%EOF

需要再次解析?

6.Adobe JS API参考

http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf

http://www.adobe.com/devnet/acrobat/javascript.html

http://patentbytes.com/automatically-completing-your-pdf-forms-part-i/

https://forums.adobe.com/thread/741050

http://www.adobepress.com/articles/article.asp?p=2158443&seqNum=3
http://www.pdfill.com/pdf_form_maker.html

使用iTextSharp填充FormField方法:
http://www.codeproject.com/Articles/23112/Fill-in-PDF-Form-Fields-using-the-Open-Source-iTex

 

pdf3pdf4

 

posted on 2016-04-26 13:46 Anders' Yan 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/yansc/p/5434799.html

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值