Quantcast
Channel: ScintillaNET Forum Rss Feed
Viewing all articles
Browse latest Browse all 296

New Post: How do it do Export to HTML ?

$
0
0
There are several major issues with the ExportHtml method. A large one being that the writer is never closed. This causes major problems such as much of the document never being written.

Some changes that would really help are as follows:

1) Convert the content to ASCII and store it temporarily. Use the temporary content for writing. This solves the encoding issue mentioned in the remarks. It can be done using the Encoding.Convert method.

2) Surround the content in a div tag like this
writer.WriteLine("<div style=\"float: left; white-space: pre; line-height: 1; \">");
.
// Write the document
.
writer.WriteLine("</div>");
Then just write the spaces directly instead of using non-breaking space.

3) Close the writer
writer.Close();
Because of these problems I would recommend writing your own function using the code above and fixes.

Viewing all articles
Browse latest Browse all 296

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>