Using ASP to generate PDF file (turn)

Source: Internet
Author: User
Tags file system html form adobe forms



The Adobe PDF format has become a common media format for many organizations and companies for Cross-platform tabulation. Although I am not a fanatic of this product, I have to accept the fact that it may be better to produce a contract in this format than word.

Having worked for a company, I've written all of our early software to run on the Internet so that we can share a common database with small subsidiaries. But the biggest problem we've encountered is tabulation. How do we get the current document (or application, etc.) when an applicant sits in an information station and fills out their employment application online? As we have done a lot of work to get the data, we also need the applicant to fill in an application by hand.

I've tried all sorts of ways, but there seems to be a big limitation:

If I could produce it quickly, it would be an HTML derivative that would be unrecognizable when printed. If the design looks a little more beautiful, it will become very slow. This is because I chose to use Rich Text format as my preference, and then use the file system object to complete the template-based RTF file, and finally added my information. This disk read and write process can take a long time. Remember: We're not here to discuss list data or an Excel spreadsheet. We want the program to be processed with our own logo.

Finally, I chose Adobe (much like a slogan?). --translator). I hate its browser, so I hope I don't get entangled with it, but it looks pretty good in format and it's not a big file. Most users install it in the system, and our customers are no exception.

So I've been looking for ways to pass data from an HTML form to a PDF file. I've tried using Adobe forms, but it doesn't really work, and then I want to count how database requests are merged. This is not really what I want, I want to direct data from my HTML form to the database, and then generate data information into the PDF file as browsing or printing.
I finally found a clue in Usenet. A link to a submission called Jeremy Hunter contains a lot of things I'm going to talk about here--http://partners.adobe.com/asn/developer/acrosdk/forms.html.

You must first install the Adobe Full edition on the workstation that defines the field (not the server). This is a link to Adobe Forms Acrobat Toolkit, so it's easy to start all over.


First, download the kit and unzip it to the specified directory.

When you do this step, you will find all the source code in VB or VC + +. We're not going to look at it here, but if you need the code right here.


Second, register your DLL.

There are two DLLs that need to be replicated to your server. One is called Fdfacx.dll in the Visual Basic folder, and the other is called Fdftk.dll in the Visual C + + folder. Register fdfacx.dll files with regsvr32. I put all two files under C:winntsystem32 and enter "regsvr32 fdftk.dll" under the current path. If you encounter error messages, check to make sure that these two files are in the current directory, and that the next step is no problem.


Third, create the form.

We will use a form that everyone is familiar with about this demo. This is freely available in "http://www.irs.gov" and provides us with enough fields to show what we can do.


Define Adobe form fields.

After you open the document in Adobe Acrobat, select the form tool to describe your first form field (Name).

After you have defined it will let you name, I am here named "FirstName". Note that there are several standard additional formatting options, in addition to font size, I choose to check the legality and format my ASP document. Since this is a quick demo, I choose to skip any checks, but I will process the form on the client and format the ASP page on the server before passing the variable.

Continue with the other fields, each of which is named and may format the font size or property.
Save your changes on the server.


Five, write ASP page.

Before you begin this step, you should note the main object of the FDF Suite Tool-"Fdfapp.fdfapp". It opens up a number of methods, and the manual outlines other possible approaches. We mainly care about two methods--fdfsetvalue and Fdfsetfile. Then cut to the chase.








There is no need to become a PDF expert, which is my current proposal. The User Guide for the Suite tool outlines all the methods, and there are many possible ways to look beyond this introductory introduction. As you can see, it's easy to add database commands to collect data or log data to the database.

Introduction of Original Author:
The Ty button was employed by a company named Cardinal Services in Oregon. Cardinal Services has been rated by Oregon Business magazine as the first hiring company in southern Oregon in 1997 and 1998, while the South Coast Business Development Center and Bank of America rated Oregon as the fastest-growing company. button is an MIS developer and spends most of its time on network database development and production process automation



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.