ASP.NETでPDFフォームフィールドを処理する
利点
- PDFフォーム内でデータを抽出、挿入、そしてアップデート。
コードの抜粋
input.pdf フォームをダウンロードする (以下の27行目)
...
'この例は、PDFテンプレート内のはじめの2つのフィールドを取り出します。
'2つのフィールドは、Name と Address です。
'そして、それらのフィールドの値は "BCL Technologies" と "Santa Clara, CA"で埋め込まれています。
Dim oLoader As Loader = Server.CreateObject("easyPDF.Loader.6")
Dim oDocument As PDFDocument = oLoader.LoadObject("easyPDF.PDFDocument.6")
oDocument.Open(Server.MapPath("./input.pdf"))
'PDFから全てのフォームフィールドを取得します。
Dim oFormFields As FormFields = oDocument.FormFields
'1番目のフォームフィールドを取得します。
Dim oFormField As FormField = oFormFields.Item(0)
Dim oTextField As TextField
If oFormField.Type = docFormFieldType.DOC_FRMTYPE_TEXT And oFormField.Name = "Name" Then
'"BCL Technologies"を Name に設定します。
oTextField = oFormField
oTextField.Value = "BCL Technologies"
End If
'2番目のフォームフィールドを設定します。
oFormField = oFormFields.Item(1)
If oFormField.Type = docFormFieldType.DOC_FRMTYPE_TEXT And oFormField.Name = "Address" Then
'"Santa Clara, CA" を Address に設定します。
oTextField = oFormField
oTextField.Value = "Santa Clara, CA"
End If
oDocument.SaveAs(Server.MapPath("./output.pdf"))
|
Download Free Trial
The Free Trial is a fully functional
software, with 30-day
expiration.
QuickStart Video
Watch a QuickStart Video on how to use easyPDF SDK in ASP and ASP.NET Web Server Environment.

PDF Features
Documentation
Testimonials from Our ASP.NET Customers
- “easyPDF SDK setup was very straightforward, unlike our experience with other products. We wrote just a few lines of code to start using it.” Read the case study
- “We evaluated many PDF tools and drivers. We even wrote our own. Except for BCL’s easyPDF SDK, all had limitations we couldn’t live with. Some only converted from MS Office and not very well. Others could not do annotation or text stamping on PDF documents. None were as easy to use and as easy to integrate.” Read the case study
|