ExcelTechnology

Create PDF File in ASP.NET

At present, blog is widely used by people. The blog owners post their articles or posts. It is possible that some posts are very useful for others, for example, knowledge about health, design. Even, some people want to print the articles.
Therefore, if authors publish the articles on blog or other article websites, they may consider to creating articles with PDF format because PDF is suitable for any operation system platform and convenient for viewing and printing.
Recently, I found a way to create PDF in ASP.NET. Although it is not perfect, in my opinion, it is very helpful.
ASP.Net programming language allows users to create PDF files dynamically by clicking a button or link.

How to Create PDF in ASP.Net

1. Go to the Web hosting control panel and then log in with users name and password.
2. Check if PDF2NET, PDFNET, or PDFRasterizer library folder exists in /libraries, /plugins or /includes folder. Before we generate PDF file with ASP code, one of these libraries should be existed. Generally speaking, the Web hosting companies provide us on or more of PDF libraries. If we cannot find the library folder, contact the provider to search for help.
3. Open the HTML file which we want to create PDF file in a text or HTML editor. Then, find the place where the link button will display in the HTML code. Create the object by following code to add the needed libraries reference.
Set pdf = Server.CreateObject("FdfApp.FdfApp")
Set pdf_file = FdfAcx.FDFCreate
4. Create PDF header value to personalize web document based on information provided by site visitors. The following code shows how to set first, middle and last name in the PDF file.
pdf_file.fdfsetvalue "Mary", FirstName, false
pdf_file.fdfsetvalue "J", MI, false
pdf_file.fdfsetvalue "Doe", LastName, false
5. Next, save the PDF file. pdf_file.FDFSaveToFile "/pdfFiles/generated_file.pdf
6. Open the PDF file in the user’s Web brower.
"http://www.abc.com/pdfFiles/generated_file.pdf"
Response.ContentType = "text/html"
7. Save the HTML file in the editor and upload the file to the Web server.

07.04.2011. u 07:13 | 0 Komentara | Print | # | ^

<< Arhiva >>

Creative Commons License
Ovaj blog je ustupljen pod Creative Commons licencom Imenovanje-Dijeli pod istim uvjetima.

< travanj, 2011 >
P U S Č P S N
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  

Kolovoz 2011 (2)
Srpanj 2011 (2)
Lipanj 2011 (2)
Svibanj 2011 (2)
Travanj 2011 (3)
Ožujak 2011 (2)
Veljača 2011 (2)
Siječanj 2011 (5)
Prosinac 2010 (5)

Dnevnik.hr
Gol.hr
Zadovoljna.hr
Novaplus.hr
NovaTV.hr
DomaTV.hr
Mojamini.tv

Opis bloga

something about Excel Technology in VB.Net and C#

Linkovi

Dnevnik.hr
Video news portal Nove TV

Blog.hr
Blog servis

Igre.hr
Najbolje igre i igrice

Forum.hr
Monitor.hr