473,385 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Exporting an ASPX's HTML to PDF

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
4 3028
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
1
by: ad | last post by:
I use the code below to export the content of a data set to Excel, the code come form http://www.dotnetjohn.com/articles.aspx?articleid=36 But it always use the web form's name as the default...
4
by: Hitesh | last post by:
Hi, I have three datagrid control on my aspx page and one export to excel button, i want to export all the 3 datagrids contents in one excel file. how can i achive that? -- Thanks Hitesh
1
by: Mustufa Baig | last post by:
I have an ASP.NET website where I am showing off crystal reports to users by exporting them to pdf format. Following is the code: ---------------- 1 Private Sub ExportReport() 2 Dim oStream...
0
by: Microsoft NewsGroups | last post by:
I am creating a TAB delimited file with .XLS extention using the Response.ContentType = "application/ms-excel" method. Normally I would place this on it's own form and delete all the HTML in the...
1
by: Yaseen D M | last post by:
I am using a third party tool to generate charts. This tool generates charts in .png or .jpg image. And in aspx page i have some more images with company logos and all, Now i want to export this...
1
by: Daniel | last post by:
Hi, We are working on a web app, where there is a export options for csv, pdf and html. Here when the export button is clicked for exporting as html "File Download" dialog window pops uo with...
1
by: itarunachalam | last post by:
Hi, We are working on a web app, where there is a export options for csv, pdf and html. Here when the export button is clicked for exporting as html "File Download" dialog window pops uo with...
1
by: steve02a | last post by:
I'm attempting to export data from a datagrid. I'm successful at exporting it in xls, doc, html types - but csv and pdf are giving me a headache. The code I'm using isn't anything fancy: ...
5
by: =?Utf-8?B?c2NobWlkdGU=?= | last post by:
Hi How can I Export an HTML Table to excel? My goal is a button, and when the user clicks this button a popup appears asking the user to 'open' or 'save' the generated Excel file. Actually...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.