Click here to Skip to main content
13,868,417 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hello Guys,

I want to dynamically convert html file or html string to PDF in Windows Forms application.

Please help.
Posted
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Please give iTextSharp[^] a try. It's a free library and can among other things be used to turn HTML into a PDF. There is even a small article here on CP to get you started: Tutorials on creating PDF files using C# 2.0[^]. Here are some more tutorials: http://www.mikesdotnetting.com/Category/20[^].
This one here is a good way to get started with iTextSharp: http://www.mikesdotnetting.com/Article/80/Create-PDFs-in-ASP.NET-getting-started-with-iTextSharp[^].

Regards,

Manfred
   
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Hi, you can also try GemBox.Document component, I think it has a really simple API.
See how to [spam link removed] with 1 line of code:
// Convert HTML to PDF in C#
DocumentModel.Load("Document.html").Save("Document.pdf");

' Convert HTML to PDF in VB.NET
DocumentModel.Load("Document.html").Save("Document.pdf")
   
v7
Comments
irfanansari 4-Oct-13 13:45pm
   
can i convert by this particular thing not completed page like
name jhone
Email: Jhone@yahoo.com
just two field not all page ?
please help me
Takalond 14-Aug-15 2:35am
   
Yes that is possible, see the LoadText method, you can insert just a piece of HTML content onto your document in the specified place (the place from which you called this method).
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Please check with following link,

Generate PDF documents from a HTML page using ASP.NET[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.190214.1 | Last Updated 31 May 2013
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100