Click here to Skip to main content
12,944,121 members (56,870 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I need a PDF converter for a C# console application, which takes HTML as input. Please suggest a converter you have used and if you know of any problems with it.
Posted 26-Apr-13 9:37am
Updated 26-Apr-13 11:20am
Sergey Alexandrovich Kryukov 26-Apr-13 15:38pm
What's going on? I just answered. Are you the students of the same school getting identical assignments, or what?! And now my answer was removed... It's a shame.
ThePhantomUpvoter 26-Apr-13 15:41pm
This is not a question or a description of a problem. We do not write code to order here either.
TnTinMn 26-Apr-13 17:05pm
At best students. At worst all bidders for the same rent-a-coder project. :(
Jasmine2501 26-Apr-13 17:17pm
There are some answers for this here:

And yes, this question is a little more complicated than I thought and there isn't a "quick answer" for it. GUYS - please don't give her crap, I asked her to post here because I don't have time for a phone call. I wanted this in the discussion area though.
Sergey Alexandrovich Kryukov 26-Apr-13 17:22pm
Bidders? Wow. I can imagine the morons who would be ready to pay them! :-)
Sergey Alexandrovich Kryukov 26-Apr-13 17:24pm
I answered in sufficient detail. Would you need more? Then it just needs a brain, which cannot be created in a forum. :-)
TnTinMn 26-Apr-13 17:40pm
It's just something that I noticed once after looking over a few of the those sites, that various forums suddenly get a lot of questions on how to code the required tasks. Maybe its a coincidence, but whenever I see a lot of posts on a topic that seems beyond a school topic, I take a look and often someone had posted a job with that requirement.

I seen something similarly fishy here a while ago, where it started off that the poster wrote the program for a friend and it changed to client at the end of the post.
Sergey Alexandrovich Kryukov 26-Apr-13 18:03pm
From time to time, this forum gets 2-5 identical questions from different people during short period of time 1-3 days...
Jasmine2501 26-Apr-13 18:18pm
Yeah I know, your answer is very good. I'm not the submitter of this question, she's a friend of mine. She doesn't understand how this site works, look at "solution 2" - I should have been more clear and asked her to post this in the discussion area.
Sergey Alexandrovich Kryukov 26-Apr-13 18:21pm
Too bad deletion of posts does not work at this time, hopefully, temporarily. This post should be removed.
Thank you,
Whiressawd 21-Aug-15 5:01am
Unfortunately there is no build in solution to this, you can use some HTML parser like HtmlAgilityPack, Majestic12 or AngleSharp (I haven't tested this one jet but it does seem efficient) together with some library for creating PDF files in C# (for example iTextSharp, PdfSharp, etc.). This would require that you iterate through the HTML content and draw the corresponding graphics on PDF document.
Or alternatively you can find some straightforward solution for HTML to PDF conversion done in C#.

1 solution

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

Solution 1

To get your input, you may or may not need to parse HTML (maybe, you generate HTML from data, then, instead of parsing, you would need to generate both HTML and PDF). Ideally, you HTML should be well-formed as XML, then you could parse it using one of .NET XML parsers. Not all Web pages are like that, unfortunately, so you may need HTML parser which does not require well-formed XML compliance. Try this one:[^].

To work with PDF, use iText, or its .NET port, iTextSharp:[^],[^],[^].

In included the reference to Java iText site as well, because most documentation is there. If you understand C#, it would not be difficult to understand Java-bases API documentation.


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
OriginalGriff 4,653
CHill60 2,970
Maciej Los 2,388
Jochen Arndt 1,900
ppolymorphe 1,765

Advertise | Privacy | Mobile
Web01 | 2.8.170518.1 | Last Updated 26 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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