Click here to Skip to main content
12,952,281 members (56,178 online)
Rate this:
Please Sign up or sign in to 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.
Posted 26-Dec-10 21:00pm
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

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

Solution 1

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)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,239
CHill60 3,490
Maciej Los 3,083
Jochen Arndt 1,975
ppolymorphe 1,880

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 22 Mar 2017
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