Link to home
Start Free TrialLog in
Avatar of carled
carledFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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.
Avatar of carled
carled
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

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!
Avatar of piyush_soni
piyush_soni

Why don't you use CutePDF to do that?
Avatar of carled

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of carled
carled
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
wkhtml2pdf can use external stylesheets.  You need to include the full url to the stylesheet (http://...) for it to be able to find it.