Click here to Skip to main content
15,036,441 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear All, I have an aspx page which contains an html like report I want to open this page in a new aspx page just as PDF Document with PDF Viewer which should provides print and other buttons.

any ideas would be much appreciated.
Updated 22-Mar-17 0:08am
qontary 27-Dec-10 3:48am
crystal report could do that
Abdul Rahman Hamidy 27-Dec-10 6:09am
would you please clarify alittle.
Abdul Rahman Hamidy 27-Dec-10 6:10am
would you please clarify alittle bit, DO I really need to use Crystal Report in my Web Application?
Sunasara Imdadhusen 27-Dec-10 6:45am
You can do it with iTextSharp library

1 solution

Dalek Dave 27-Dec-10 18:10pm
Good Link
Abdul Rahman Hamidy 29-Dec-10 4:25am
thanks for reply, I dont wanna save my html page to SERVER, I just want to read it from stream.
I am looking to convert my html page directly to PDF without saving PDF file to server.
Cansid 22-Sep-15 6:07am
Abdul here is something that I'm using:

string htmlText = null;
var inputOptions = LoadOptions.HtmlDefault;
var outputOptions = SaveOptions.PdfDefault;

using (var htmlStream = new MemoryStream(inputOptions.Encoding.GetBytes(htmlText)))
DocumentModel.Load(htmlStream, inputOptions)
.Save(this.Response, outputOptions);

The code I used is from this article of converting html into a pdf with C#. You may noticed that both input html and output pdf can be a physical file or a stream. Also you can notice that I used a Response with the save method, this directly exports pdf to client.

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900