output aspx page "as is" to pdf

Hello there. I’m looking for a component that helps me to create a pdf from a page containing image, gridview, html, text and it is styled with a linked stylesheet.

The page is rendered using database and code behind calculations and displayed to the customer.  I then have a “save as pdf” button on there.  What I don’t want to have to do is recreate step-by-step the entire page again – it’s already there in memory.  However, it’s an aspx page and not an html page, so I’m just curious if I can use a tool to just simply output the html generated by the aspx code direct to pdf?

I've seen many examples converting existing ".html" files from a url but I haven't found anything that converts what has just been rendered.

I tried using itextsharp, but it just generates an ugly plain page without formatting colours and styles.
LVL 1
carledAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

carledAuthor Commented:
Oh and importantly the page contains an ms chart component rendered to screen on the fly and that needs to be included on the pdf!
0
piyush_soniCommented:
Why don't you use CutePDF to do that?
0
carledAuthor Commented:
Well, maybe I'm missing something, but that looks like a document converter?  I'm after something that runs on my web server (I'm developing the website) that allows the website user to "save this result page as a pdf" and it creates the pdf using the html code rendered by the aspx page...?

Am I missing something here?
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

RameshSCommented:
0
carledAuthor Commented:
at $600? No thanks!  I did it in the end using wkhtml2pdf (free) by redoing the page with inline styles and cut-down graphics and things. A real p.i.t.a. but it achieved the desired results without shelling out silly money.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
piyush_soniCommented:
Oops. Sorry, I did not notice you are developing a website and you want your users to do that. I thought you want to do that :) Appologies.
0
Doug PoulinCTOCommented:
wkhtml2pdf can use external stylesheets.  You need to include the full url to the stylesheet (http://...) for it to be able to find it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.