By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,009 Members | 1,273 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,009 IT Pros & Developers. It's quick & easy.

Exporting an ASPX's HTML to PDF

P: n/a
I am looking for a way to sort of redirect the Page.Response content to a
pdf generator component that would create a pdf file on the fly! I wonder
if there is such a thing in the .net world. I see a java based product that
may do this (from CORDA).

This is really my problem: My asp.net page creates a complex report using
web controls and I would like to be able to overcome browser printing issues
by converting the resulting html to pdf on the fly. I would like to avoid
recreating these reports/pages using a 3rd party pdf component's object
model.

TIA,
John
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
It seems CORDA can also be used for .NET.
http://corda.com/devzone/code/showcode.html?
id=3&platform=aspx_cs

HTH

Elton Wang
el********@hotmail.com

-----Original Message-----
I am looking for a way to sort of redirect the Page.Response content to apdf generator component that would create a pdf file on the fly! I wonderif there is such a thing in the .net world. I see a java based product thatmay do this (from CORDA).

This is really my problem: My asp.net page creates a complex report usingweb controls and I would like to be able to overcome browser printing issuesby converting the resulting html to pdf on the fly. I would like to avoidrecreating these reports/pages using a 3rd party pdf component's objectmodel.

TIA,
John
.

Nov 19 '05 #2

P: n/a
Perhaps this free PDF code will be of use to you:
http://www.ujihara.jp/iTextdotNET/en/index.html

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Valerian John" <vj***@shentel.net> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
I am looking for a way to sort of redirect the Page.Response content to a
pdf generator component that would create a pdf file on the fly! I wonder
if there is such a thing in the .net world. I see a java based product
that may do this (from CORDA).

This is really my problem: My asp.net page creates a complex report using
web controls and I would like to be able to overcome browser printing
issues by converting the resulting html to pdf on the fly. I would like
to avoid recreating these reports/pages using a 3rd party pdf component's
object model.

TIA,
John

Nov 19 '05 #3

P: n/a
neither itext nor corda support more than the simplest html (1.0), no style
support,etc. if you can live with this, have your page use webclient to call
report apsx page, then convert the html to pdf and write back to the client.

-- bruce (sqlwork.com)
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:uN*************@TK2MSFTNGP15.phx.gbl...
Perhaps this free PDF code will be of use to you:
http://www.ujihara.jp/iTextdotNET/en/index.html

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Valerian John" <vj***@shentel.net> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
I am looking for a way to sort of redirect the Page.Response content to a
pdf generator component that would create a pdf file on the fly! I wonder
if there is such a thing in the .net world. I see a java based product
that may do this (from CORDA).

This is really my problem: My asp.net page creates a complex report
using web controls and I would like to be able to overcome browser
printing issues by converting the resulting html to pdf on the fly. I
would like to avoid recreating these reports/pages using a 3rd party pdf
component's object model.

TIA,
John


Nov 19 '05 #4

P: n/a
Thank you, Elton, Steve and Bruce for your responses/help. (Steve: good
articles on your website)

I did run into the iText and HTMLDOC tools but like Bruce has noted they
only do simple html. I also checked out Aspose.pdf and they have a similar
problem (under development).

The suggestion about WebClient seems plausible. Is this how one can do
this? (cut/paste from MSDN) I guess it would still be plain html without
css because css is really applied by the browser on the client-side?
(Perhaps I must use Aspose.pdf, or similar, and recreate the report using
the pdf object model!)

***********
' Initialize the WebRequest.
Dim myRequest As WebRequest = WebRequest.Create("http://www.contoso.com")
' Return the response.
Dim myResponse As WebResponse = myRequest.GetResponse()
'Set the appropriate ContentType
Response.ContentType = "Application/pdf"
'Get the physical path to the file.
Dim FilePath As String = MapPath("acrobat.pdf")
'Write the file directly to the HTTP output stream.
Response.WriteFile(FilePath)
Response.End()
Response.Redirect("acrobat.pdf")
' Close the response to free resources.
myResponse.Close()
***********

TIA,
John

(aside: How is Developersdex able to forward reponses to one's post here?)

"Bruce Barker" <br******************@safeco.com> wrote in message
news:eZ**************@TK2MSFTNGP10.phx.gbl...
neither itext nor corda support more than the simplest html (1.0), no
style support,etc. if you can live with this, have your page use webclient
to call report apsx page, then convert the html to pdf and write back to
the client.

-- bruce (sqlwork.com)
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:uN*************@TK2MSFTNGP15.phx.gbl...
Perhaps this free PDF code will be of use to you:
http://www.ujihara.jp/iTextdotNET/en/index.html

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Valerian John" <vj***@shentel.net> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
I am looking for a way to sort of redirect the Page.Response content to a
pdf generator component that would create a pdf file on the fly! I
wonder if there is such a thing in the .net world. I see a java based
product that may do this (from CORDA).

This is really my problem: My asp.net page creates a complex report
using web controls and I would like to be able to overcome browser
printing issues by converting the resulting html to pdf on the fly. I
would like to avoid recreating these reports/pages using a 3rd party pdf
component's object model.

TIA,
John



Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.