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.
Rate this: bad
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:[^].
This one here is a good way to get started with iTextSharp:[^].


Rate this: bad
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#

' Convert HTML to PDF in VB.NET
irfanansari 4-Oct-13 13:45pm
can i convert by this particular thing not completed page like
name jhone
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
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