J
John Kotuby
Hi all,
I am using a 3rd party program in a VS2005 web project. The tool takes as
input a string containing HTML and converts it to RTF.
I have been creating a page by dynamically loading UserControls and then
sending the page to the browser.
Now I want to write the contents of the the page to a string variable,
convert that variable to the RTF and send that to the browser and I am stuck
on the "simple" part of getting the contents of the rendered page into a
string var. It also occurs to me that maybe I might not be able to get the
rendered page from the LoadComplete sub.
Below is some code that demonstrates how the 3rd party control should work.
Note that the code
"Dim htmlString = Response.Output" indicates my lack of understanding of how
to get the rendered contents of the page into a string variable, which I am
trying to do. I have been looking at the Response object to accomplish this
task but maybe I am looking in the wrong place.
Also, can I likewise persist the contents of a page that I have assembled in
..NET to a file on the server itself, rather than sending it to the browser?
--------------------------
Protected Sub Common_DeckRTFOutput_LoadComplete(ByVal sender As Object,
ByVal e As System.EventArgs) Handles Me.LoadComplete
Dim htmlString = Response.Output
Dim rtfString As String = ""
'create object (instance) of html2rtf converter
Dim h As SautinSoft.HtmlToRtf.Converter = New
SautinSoft.HtmlToRtf.Converter()
If Not h Is Nothing Then
'set converter options
h.OutputTextFormat = SautinSoft.HtmlToRtf.eOutputTextFormat.Rtf
h.HtmlPath = "C:\development\powercard.net"
'convert strings
rtfString = h.ConvertString(htmlString)
Response.Write(rtfString)
End If
End Sub
I am using a 3rd party program in a VS2005 web project. The tool takes as
input a string containing HTML and converts it to RTF.
I have been creating a page by dynamically loading UserControls and then
sending the page to the browser.
Now I want to write the contents of the the page to a string variable,
convert that variable to the RTF and send that to the browser and I am stuck
on the "simple" part of getting the contents of the rendered page into a
string var. It also occurs to me that maybe I might not be able to get the
rendered page from the LoadComplete sub.
Below is some code that demonstrates how the 3rd party control should work.
Note that the code
"Dim htmlString = Response.Output" indicates my lack of understanding of how
to get the rendered contents of the page into a string variable, which I am
trying to do. I have been looking at the Response object to accomplish this
task but maybe I am looking in the wrong place.
Also, can I likewise persist the contents of a page that I have assembled in
..NET to a file on the server itself, rather than sending it to the browser?
--------------------------
Protected Sub Common_DeckRTFOutput_LoadComplete(ByVal sender As Object,
ByVal e As System.EventArgs) Handles Me.LoadComplete
Dim htmlString = Response.Output
Dim rtfString As String = ""
'create object (instance) of html2rtf converter
Dim h As SautinSoft.HtmlToRtf.Converter = New
SautinSoft.HtmlToRtf.Converter()
If Not h Is Nothing Then
'set converter options
h.OutputTextFormat = SautinSoft.HtmlToRtf.eOutputTextFormat.Rtf
h.HtmlPath = "C:\development\powercard.net"
'convert strings
rtfString = h.ConvertString(htmlString)
Response.Write(rtfString)
End If
End Sub