473,626 Members | 3,389 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3045
It seems CORDA can also be used for .NET.
http://corda.com/devzone/code/showcode.html?
id=3&platform=a spx_cs

HTH

Elton Wang
el********@hotm ail.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******** *******@TK2MSFT NGP12.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.ne t> wrote in message
news:uN******** *****@TK2MSFTNG P15.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******** *******@TK2MSFT NGP12.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.Crea te("http://www.contoso.com ")
' Return the response.
Dim myResponse As WebResponse = myRequest.GetRe sponse()
'Set the appropriate ContentType
Response.Conten tType = "Applicatio n/pdf"
'Get the physical path to the file.
Dim FilePath As String = MapPath("acroba t.pdf")
'Write the file directly to the HTTP output stream.
Response.WriteF ile(FilePath)
Response.End()
Response.Redire ct("acrobat.pdf ")
' Close the response to free resources.
myResponse.Clos e()
***********

TIA,
John

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

"Bruce Barker" <br************ ******@safeco.c om> wrote in message
news:eZ******** ******@TK2MSFTN GP10.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.ne t> wrote in message
news:uN******** *****@TK2MSFTNG P15.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******** *******@TK2MSFT NGP12.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
9237
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 only exporting to single worksheet. but i need to export data to multiple worksheets. it is very urgent to us. so please help me in code.
1
2306
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 name of excel. Can we specify a meaningful filename before exporting to EXCEL? ------------------------------------------------------------------------------------------- 'first let's clean up the response.object response.Clear()
4
6180
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
3157
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 As System.IO.MemoryStream = 3 myReport.ExportToStream( ExportFormatType.PortableDocFormat) 4 Response.Clear() 5 Response.Buffer() = True
0
5666
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 ASPX page - otherwise the aspx code gets appended to the end of the file out put to Excel. How do I produce the same output from a page where I cannot simply delete all the HTML code (must leave buttons and other objects intact)? In other words how...
1
1896
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 .aspx page to word, excel and pdf. I searched on net for the help, but i didn't find any solution. Does anybody knows how to export? If you have any code snippet just pass me on. i need it very urgent.
1
1172
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 open, save and cancel. If we hit the open button, the html page opens in the same window. But we want tht to open in a seperate window. This happens only whn the user clicks the open button rather that the save button for exporting. Is there a option...
1
1340
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 open, save and cancel. If we hit the open button, the html page opens in the same window. But we want tht to open in a seperate window. This happens only whn the user clicks the open button rather that the save button for exporting. Is there a option...
1
1426
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: Response.ContentType="application/pdf"; Response.AddHeader("content-disposition","fileattachment;filename=whatever.pdf"); Response.Write(oStringWriter.ToString()); Response.End(); break;
5
4167
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 I'm exporting by rendering my table to an htmlwriter and sending this to excel. This is working nearly perfect. There's a problem with Excel's auto-formatting of cells. Excel is changing the content of my cells. '1.23' is getting 'Jan 23',
0
8202
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8641
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5575
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2628
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.