Use ASP to generate PDF files

Source: Internet
Author: User
Tags adobe forms
Adobe PDF has become a common media format used by many organizations and companies for cross-platform tabulation. Although I am not an avid fan of this product, I have to accept the fact that using this format to generate an agreement may be better than using word.

Since I work in a hiring company, I have written all of our early software to run on the Internet, so that we can share public databases with small subsidiaries. However, the biggest problem we encounter is tabulation. How can we obtain the current document (or application) When an applicant is sitting in the information station and filling in their employment application online )? Since we have done a lot of work to obtain data, we also need the applicant to manually fill out an application.

I tried a variety of methods, but it seems that there is a huge limit:

If I can generate it quickly, it can only be a derivative in the form of HTML, and it will become completely invisible during printing. If the design looks more beautiful, it will become very slow. This is because I chose to use the RTF format as my preference, and then use the File System Object to complete the template-based RTF file, and finally add my information. The read/write process of this disk takes a long time. Remember: we are not discussing list data or an Excel worksheet here. We want the program to process it with our own logo.

Finally, I chose adobe? -- Translator ). I hate its browser, so I hope I won't be entangled with it, but its format looks good and the file is not big. Most users install it on the system, and our customers are no exception.

Therefore, I have been searching for methods to pass data from HTML forms to PDF files. I have tried using Adobe forms, but it cannot really run effectively, and I have to count how to merge database requests. This is not what I want at all. I want to directly pass data from my HTML form to the database, and then generate data information to the PDF file for browsing or printing.
Finally, I found a clue at Usenet. A link submitted by Jeremy hunter contains many things I want to talk about here-http://partners.adobe.com/asn/#/acrosdk/forms.html.

First, you must install the Adobe full version on the workstation (not the server) that defines the field. This is a link to Adobe forms acrobat toolkit, and everything starts to be easy.

1. Download the tool package and decompress it to the specified directory.

When you perform this step, you will find that all source code is in VB or VC ++. We don't want to pay attention to it here, but it is here if you need code.

2. register your DLL.

Two DLL files need to be copied to your server. One is fdfacx. dll in the Visual Basic folder, and the other is fdftk. dll in the Visual C ++ folder. Register the fdfacx. dll file with regsvr32. I put both files under C: winntsystem32 and enter "regsvr32 fdftk. dll" in the current path ". If you encounter an error message, check whether the two files are in the current directory. If there is no problem, proceed to the next step.

3. Create a form.

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

4. Define Adobe form fields.

Open the document in Adobe Acrobat and select the form tool to describe your first form field (first name ).

After your definition, it will let you name it. Here I name it "firstname ". Note that there are several standard additional format options, except for the font size, I choose to check the validity and format my asp document. As this is a quick demonstration, I chose to skip any check, but I will process the form on the client side and format the ASP page on the server before passing the variable.

To continue with other fields, remember to name each field and format the font size or attributes.
Save your changes on the server.

5. Compile the ASP page.

Before proceeding to this step, you should note that one of the main objects described in The FDF tool package is "fdfapp. fdfapp ". It opens up many methods, and the Manual outlines other possible methods. We mainly care about two methods: fdfsetvalue and fdfsetfile. Next, let's start with the topic.

Sixth, there is no need to become a PDF expert. This is my current suggestion. The User Guide of the tool set provides an overview of all the methods. It seems that there are many possible methods beyond this introduction. As you can see, you can easily add database commands to collect data or record data to the database.

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.