Click here to Skip to main content
Click here to Skip to main content

XHTML2RTF: An HTML to RTF conversion tool based on XSL

By , 29 Dec 2005
 

Overview

This article describes a conversion tool which takes an HTML document as input and generates a Microsoft Word document for printing.

It all started when I had to work on a new information system with hundreds of computers. We decided to go for a 100% web-based application. Everything was fine until we had to print official documents from the application...

Although there are standardization efforts in progress (both at the W3C with XHTML-PRINT and IEEE with the Print Working Group), and besides some good tools to print HTML (HTML Print from Bersoft, ScriptX from MeadCo), none of these seemed to address my needs. I wanted to keep my Web-based application, and reuse the generated HTML to feed a printer...

Have you tried to print HTML documents? Have you tried to format your HTML documents for printing, with specific fonts, sizes, headers, footers, and margins?

If you have, then you know that HTML is not appropriate for printing - but you can find other formats and use new tools to convert HTML documents into Microsoft Word format, a format suitable for printing... And this is what this article is about.

Contents

Features

The XHTML2RTF conversion tool:

Introduction

The XHTML2RTF conversion tool uses XSL style sheet to convert an XHTML document into an RTF document, suitable for previewing and printing with Word (or Word Viewer).

XHTML = HTML + XML

The Extensible HyperText Markup Language (XHTML) is a family of current and future document types and modules that reproduce, subset, and extend HTML, reformulated in XML. XHTML family document types are all XML-based, and ultimately are designed to work in conjunction with XML-based user agents. XHTML is the successor of HTML, and a series of specifications has been developed for XHTML.

The XHTML2RTF conversion tool reads XHTML documents as input. As a consequence, you have to adapt your application in order to use this tool.

XSL

XSL stands for eXtensible Stylesheet Language. It is a family of recommendations for defining XML document transformation and presentation. It consists of three parts:

  1. A programming language for transforming XML documents: XSL Transformations (XSLT).
  2. An expression language used by XSLT to access or refer to parts of an XML document: XML Path Language (XPath). This language provides pattern matching (xsl:template match), conditional statements (xsl:when test), loops (for-each), etc...
  3. An XML vocabulary for specifying formatting semantics: similar to W3C cascading style sheets (CSS), this vocabulary provides enhanced presentation features.

For more about XSL, please refer to XSL references pages.

The XHTML2RTF conversion tool uses XSL to transform XHTML documents (XML documents) into RTF documents. This is the core of the tool - anything else is just a glue to build your application. Everything is in the XSL style sheet.

Microsoft XML SDK 3.0

Microsoft provides an XML SDK for processing XML and XSL documents. It's often installed with the operating system, but you can download and install the latest SDK. See References section for more on MSXML SDK.

The XHTML2RTF conversion tool uses XML SDK objects and methods to process XHTML and transform it into RTF. XML SDK API is available to Web application as well as batch applications and so is the XHTML2RTF conversion tool.

Microsoft Rich Text Format (RTF)

Microsoft created an exchange format for Word documents: Rich Text Format (RTF). Unlike the native Word format, it is documented; moreover, RTF has been here for some time (so you can view RTF documents with good old Word 97). There is also a free RTF viewer (Word 97/2000 Viewer), and even WordPad (installed with most Windows releases) can open, view and edit RTF documents.

XHTML2RTF

The XHTML to RTF converter consists of an XSL style sheet for parsing XHTML tags and generating their RTF equivalents.

Usage

From HTML to XHTML

You have to adapt your application to generate XHTML documents if you want to use the XHTML2RTF conversion tool:

  • Include an XML declaration at the beginning of the document:
    <?xml version="1.0" encoding="iso-8859-1" ?>
  • Include XHTML namespace declaration (the default) and XHTML2RTF namespace declaration in tag <html>:
    <html 
       xmlns="http://www.w3.org/1999/xhtml" 
       xmlns:xhtml2rtf=
         "http://www.lutecia.info/download/xmlns/xhtml2rtf">
    ...
    </html>
  • Use lower case for both tag names and attribute names:
    • <P></P> becomes <p></p>
    • <A HREF="...">...</a> becomes <a href="...">...</a>
    • etc...
  • Add termination for all tags (XHTML is more strict than HTML):
    • <link rel="stylesheet" href="..."> becomes <link rel="stylesheet" href="..." />
    • <hr> becomes <hr />
    • <br> becomes <br />
  • Quote all attribute values:
    • <table class=noprint> becomes <table class="noprint">
    • <a href=mypage.asp> becomes <a href="/KB/HTML/mypage.asp">
  • Use encoded characters for non-ASCII and/or special characters:
    • & becomes &amp;
    • é becomes &#233;
    • è becomes &#232; etc...
  • Replace HTML character entities by their code (XML knows very few character entity references - use character codes instead):
    • &nbsp; becomes &#160;
    • è becomes &#232;
    • é becomes &#233;
    • ê becomes &#234; etc...
  • Do not use direct style for tags (use class and an external CSS style sheet instead)
    • <div style='background:#c0c0c0; font-size: 125%; padding:1.0pt 10.0pt 1.0pt 10.0pt;'>
      becomes <div class="mydivstyle">.

Thus, you will be able to customize the RTF output for your class (it's too hard to parse an HTML style declaration within an XSL style sheet).

Spaces in HTML and RTF

In HTML, spaces are not significant - most browsers ignore them when they render the document. On the other hand, Microsoft Word (and RTF) render spaces as visible characters. Be careful when building your HTML document: do not generate spaces or they will be shown in your Word document.

Header and footer in HTML and RTF

The default header in the RTF document contains the HTML <title> (from the <head> section). You can change the header by setting the parameters header-font-size-default, header-distance-from-edge, and header-indentation-left (see parameters below). You can also create your own header by using the classes "rtf_header" and "rtf_header_first" in your HTML document:

  • rtf_header_first defines a complete HTML content for the header on the first page of the document
  • rtf_header defines a complete HTML content for the header on all other pages of the document

The default footer in the RTF document contains the page number and the document date (current date and time; i.e. print date and time). You can change the footer by setting the parameters footer-font-size-default, footer-distance-from-edge and use-default-footer (see parameters below).

Page break

To force a page break in your RTF document, you can use the CSS style "page-break-before" or "page-break-after" with the value "always":

This is on page 1
<p style="page-break-before:always"/>
This is on page 2

Note that other values for these CSS styles (left, right, auto...) are not supported (only "always" is supported).

XSL style sheet parameters

The XSL style sheet xhtml2rtf.xsl provides a set of parameters so that you can change the stylesheet's default behavior:

  • page-start-number: Page start number (default: 1)
  • page-setup-paper-width: Paper width in TWIPS (default: 11907 TWIPS = 21 cm, i.e. A4 format)
  • page-setup-paper-height: Paper height in TWIPS (default: 16840 TWIPS = 29.7 cm, i.e. A4 format)
  • page-setup-margin-top: Top margin in TWIPS (default: 1440 TWIPS = 1 inch = 2.54 cm)
  • page-setup-margin-bottom: Bottom margin in TWIPS (default: 1440 TWIPS = 1 inch = 2.54 cm)
  • page-setup-margin-left: Left margin in TWIPS (default: 1134 TWIPS = 2 cm)
  • page-setup-margin-right: Right margin in TWIPS (default: 1134 TWIPS = 2 cm)
  • font-size-default: Default font size in TWIPS (default: 20 TWIPS = 10 pt.)
  • font-name-default: Default font name (default: 'Times New Roman')
  • font-name-fixed: Default font name for fixed-width text, like PRE or CODE (default: 'Courier New')
  • font-name-barcode: Barcode font name (default: '3 of 9 Barcode')
  • header-font-size-default: Header default font size in TWIPS (default: 14 TWIPS = 7 pt.)
  • header-distance-from-edge: Default distance between top of page and top of header, in TWIPS (default: 720 TWIPS = 1.27 cm)
  • header-indentation-left: Header left indentation in TWIPS (default: 0)
  • footer-font-size-default: Footer default font size in TWIPS (default: 14 TWIPS = 7 pt.)
  • footer-distance-from-edge: Default distance between bottom of page and bottom of footer, in TWIPS (default: 720 TWIPS = 1.27 cm)
  • use-default-footer: Boolean flag: 1 to use default footer (page number and date) or 0 no footer (default: 1)
  • document-protected: Boolean flag: 1 protected (cannot be modified) or 0 unprotected (default: 1)
  • normalize-space: Boolean flag: 1 spaces are normalized and trimmed, or 0 no normalization no trim (default: 0)
  • my-normalize-space: Boolean flag: 1 spaces are normalized (not trimmed), or 0 no normalization (default: 1)

Batch mode (WSH)

I wrote a BATCH program (XHTML2RTF.BAT) which relies on Windows Script Host (WSH) to call the XML DOM SDK and transforms an HTML file into its RTF equivalent (output is done in stdout).

To use this component from batch: call the program XHTML2RTF.BAT with the HTML file name as parameter. The RTF file is generated in stdout, so you should redirect the output with the ">" operator. Then you can open the generated file with Microsoft Word (or Wordpad):

C:\> XHTML2RTF.BAT Readme.htm > Readme.rtf
C:\> START WINWORD Readme.rtf

To pass parameters to the XHTML2RTF program, use the -p flag followed by the parameter name and value.

For example:

C:\> XHTML2RTF.BAT -p page-start-number=5 -p document-protected=0 
              -p font-name-default='Arial' Readme.htm > Readme.rtf
C:\> START WINWORD Readme.rtf

Web-based (ASP)

I wrote a simple ASP library to call the component from an ASP page, producing RTF document from live, dynamic content (results from a SQL database request, for example).

To use this component from a web page, you have to include the XHTML2RTF.inc file in your page, and call the function XHTMLString2RTF(), passing the XHTML document (as a string):

  <!--#include file="XHTML2RTF.inc"-->
  var strXHTML = " \
  <html xmlns=\"http://www.w3.org/1999/xhtml\" 
        xmlns:xhtml2rtf=
            \"http://www.lutecia.info/download/xmlns/xhtml2rtf\"> \
    <head> \
      <title>Hello, World! from string</title> \
    </head> \
    <body> \
      <h1>Hello, World!</h1> \
    </body> \
  </html> \
  ";
  XHTMLString2RTF(strXHTML);

Note: The real production system uses SQL requests, generates XML output, transforms it into XHTML via a first XSL style sheet, and then transforms it into an RTF document. The example above is just that - an example for demonstration purposes. Please do not generate HTML via strings on your production system ;-)

Raw RTF output

The XHTML2RTF conversion tool provides a direct RTF output with no rendering in XHTML. The tool processes a special tag (<xhtml2rtf:raw>) to send the RTF directly. For example, this code will send a TAB character in the RTF output: <xhtml2rtf:raw class="rtf">\tab </xhtml2rtf:raw>. This code will not be rendered in your Web browser, since the class "rtf" is defined in the CSS style sheet as "display:none".

There are many uses for this raw output - in particular, you can work around most of the current limitations in the conversion tool (as listed in the TODO section). For example, you can send the RTF code for an image, even if the conversion tool doesn't handle images yet:

<xhtml2rtf:raw class="rtf">
 {\*\shppict{\pict\picw3043\pich3043\picwgoal1725\pichgoal1725\pngblip
  89504e470d0a1a0a0000000d49484452000000730000007308020000002421
  aab1000000017352474200aece1ce90000000467414d410000b18f0bfc61050000
  ...
 }}
</xhtml2rtf:raw>

To find out what RTF code is appropriate for this image, I just used Word to edit a document with a picture, and then saved it in the RTF format. I opened the resulting file as text, and copied/pasted the RTF code into the XHTML output, within the <xhtml2rtf:raw> tags.

RTF-specific fields

Some RTF-specific fields are available in the conversion tool.

Page number

You can display the current page number in your RTF document via <xhtml2rtf:page_number>:

PAGE <xhtml2rtf:page_number/>
Total number of pages

You can display total number of pages in your RTF document via <xhtml2rtf:total_number_of_pages>:

PAGE <xhtml2rtf:page_number/> / <xhtml2rtf:total_number_of_pages/>

Samples

  1. Hello, World! (HTML and RTF)
  2. Custom Header, two pages (HTML and RTF)
  3. No Footer (HTML and RTF)
  4. Table (HTML and RTF)
  5. The Readme file you're reading in RTF

Implementation

  • The XHTML to RTF converter consists of an XSL style sheet for parsing XHTML tags and generating their RTF equivalents.

To do list

References

Acknowledgements

Many thanks to 2can for his table support added to my original source code.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Emmanuel Kartmann
Web Developer
France France
Member
Fell into computer software at the age of 11, founder of 3 startups, and now manager of an independent software vendor (ISV) labelled proSDK (www.prosdk.com)... And still a freeware writer and technical article author!

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionASP ImplementationmemberLouis Stephen Russell10 Aug '11 - 22:12 
Hi Guys,
 
Forgive me if I'm being an idiot but I'm trying to implement this into an asp page and failing miserably with compilation errors. I am following the instructions provided but when trying to load the asp page I am getting a VBScript compilation error from the { brackets in the inc file.
 
As you can probably guess I have basic asp knowledge and it's been a long time since I did any VB work as I mainly code in C#.
 
If anyone could point me in any direction of what I could do to get this compiling and working I would be most grateful.
 
Thanks All!
~~
Louington Ackbar

Questionsomething missing?memberdanino7631 Aug '09 - 5:32 
i've got an error on function xhtml2rtf:TableCellWidthFill(), it should be defined in xmlns ../download/xmlns/xhtml2rtf , but the requested URL was not found on www.lutecia.info, how can i do?
 
thanks.
AnswerRe: something missing? [modified]memberecasabuena20 May '10 - 21:38 
TableCellWidthFill is not working, it throws an error "Function not defined" in this line of code
var objRowNodes = objRowNodes[0].selectNodes("./*");
 
updated:
 
i've come up to a solution on how to not encounter this error, i've converted the javascript to C#, and works fine nows.
GeneralRe: something missing?memberGray08185 Oct '10 - 20:11 
where can we find the updated .xsl? Smile | :)
 
Thanks!
Gray Gonzalez

GeneralEmbedding pngsmemberPaulMdx16 Aug '09 - 9:09 
I might have a go myself when I get time, however for the <img> tag support todo item you might like to see:
 
http://jerryclin.wordpress.com/2008/03/18/embedding-pngs-into-rtf-files/[^]
General<sup>Superscript</sup> and <sub>subscript</sub> are missing.membermrwisdom7 Dec '08 - 21:07 
It's a really good and useful article.
 
I'm not familiar with the syntax of RTF. I just added these two lines, and it worked.
 
<xsl:template match="xhtml:sub"><xsl:param name="preformatted" select="0"/>{\sub <xsl:apply-templates><xsl:with-param name="preformatted" select="$preformatted"/></xsl:apply-templates>}</xsl:template>
 
<xsl:template match="xhtml:sup"><xsl:param name="preformatted" select="0"/>{\super <xsl:apply-templates><xsl:with-param name="preformatted" select="$preformatted"/></xsl:apply-templates>}</xsl:template>
GeneralWould you be open to this project being developed on www.codeplex.commemberTatworth10 Jun '08 - 1:13 
Would you be open to your project being further developed on www.codeplex.com?
 
mcp111 on ASP.NET fourum thread http://forums.asp.net/p/1267755/2412969.aspx#2412969[^] would like to develop the idea further.
GeneralRe: Would you be open to this project being developed on www.codeplex.commemberEmmanuel Kartmann10 Jun '08 - 1:40 
Yes. this is 100% freeware - but I have no spare time to enhance it, sorry!
 
Feel free to modify/improve it. Please keep it free, and please keep me posted.
 
Regards,
 
E.
GeneralRTF to HTMLmemberchankl782 Jun '08 - 6:12 
Hi, I saw this wonderful article.
 
I have seen some samples from HTML to RTF
But, is there a way to convert from HTML to RTF & store it into a MSSQL 2005 Database through asp.net coding?
 
Thanks.
 
Smile
chankl78

Generalprint xslmemberTheEagle24 Apr '07 - 2:10 
I have a webform that includs the xml web server control which uses the xml file and xsl file to show my CV data(doesn't use ado.net) So how could I get a printable format like PDF from this page?.
 
I am too late but i will never give up

QuestionXML to HTML conversio?membermshubhu19 Nov '06 - 19:34 
How to convert XML file in HTML file using XSL?
Can we create XSL file for XML. (My XML changes continuously)
GeneralCSS questionmemberthecodeprojectsux15 Feb '06 - 0:59 
Hi,
 
According to your article while embedded CSS stylesheets are not supported, external ones should be. I'm having great trouble getting this working. The browser displays the XHTML fine, but the RTF does not reflect the CSS selectors color, background-color, font, text-align, border, and probably others.
 
Is this correct? If so how is CSS styling applied to the XHTML document?
 
PS Please excuse the username, it's the first one at bugmenot that worked...
GeneralGreat article, some errorsmemberAnders Dalvander27 Dec '05 - 23:46 
Awesome article!
 
I found some errors (using Firefox 1.5), the before (search-for) and after (replace-with) list for encoded characters and HTML character entities look the same.
GeneralRe: Great article, some errorsmemberEmmanuel Kartmann28 Dec '05 - 3:51 
Thanks!
 
It seems that the original code has been corrupted when "reformatted" by people at Codeproject (the original - downloadable version displays correctly). I've noticed the reviewers at codeproject so they could fix it...
 
Cheers,
 
E.

QuestionWhat about XS-FO?sussRodman112 Sep '05 - 11:27 
Seems like you could get more flexible output from an XSFO script. Including all the ToDo items listed (lists, tables, etc...). And target more formats like PDF.
 
Or am I missing something?
GeneralFor a complete RTF 2 HTML Converter...memberPopeye Doyle Murray25 Apr '05 - 4:47 
I found that Starpoint Software's worked well.
 
http://www.pointstar.com/Starpoint/rtf2html.asp[^]
 
It is commercial, but you get what you pay for and it converts both ways.
GeneralRe: For a complete RTF 2 HTML Converter...memberJeffrey Scott Flesher22 Jul '05 - 20:32 
I think your missing the sprite of Code Project; if we wanted Commercial we wouldn’t be here.
 
Lessons learned from 911:

1. United We Stand.

2. United’s We Fall.

Gulf War Syndrome survivors never have a good day. http://www.vetshelpcenter.com/

Generaltable enhancementmember2can12 Mar '05 - 23:51 
well, i added support for <table> <tr> and <td> tags.
<table> can contain border attribute.

look here
 
there're still some problems, but i hope general idia is fine.
 
added JScript functions:
TableCellWidthFill
GetTableColumnWidth

GeneralRe: table enhancementmemberBuffalo Charmer18 May '05 - 9:04 
I would like to have a look at your table fix. Unless this thing supports tables, it's next to useless. What if you have columns of numbers that are being calculated in an ASP process that then produces this html file? Without preserving columns and rows how can one get a decent printout?
 
~`^%
GeneralRe: table enhancementmember2can18 May '05 - 11:06 
the link i gave still works. you can get it and try.
 
try converting this one

<table width="50%">
<tr>
<td align="right">Date</td>
<td align="left"><b>28 September 2005</b></td>
</tr>
<tr>
<td align="right">Username</td>
<td align="left"><b>Anna Maria X</b></td>
</tr>
<tr>
<td align="right">Password</td>
<td align="left"><b>abracadabra ABRACADABRA</b></td>
<tr>
<table>

GeneralReally good, good, good work. Thank you!!!memberwaxon1712 Feb '05 - 0:59 
Hello, Emmanuel.
 
I'm using this great code. Most useful for me was the XSLT file, that I'm using to build an ASP.NET export document option. I'd like to publish it when I finish.
 
In other hand, another advantages of using RTF is that almost any modern word processor can read it. It includes, for example, Openoffice and StarOffice. These can read RTF's without any problem.
 
Thanks again.
GeneralRe: Really good, good, good work. Thank you!!!memberEmmanuel Kartmann12 Feb '05 - 1:52 
Cool - glad you liked it!
 
Never used OpenOffice/StarOffice (I thought these were dead Wink | ;-) , but if they support RTF, you can have a 100% freeware printing system... Really cool.
 
If you make any change in the XSLT file, please let me know - send me the URL if you publish it anywhere; I'd like to maintain the same level of support for HTML/RTF on my production system (using good old ASP). The current level of support is... hum... poor! Any improvement is welcome...
 
Cheers,
 
E.

GeneralRe: Really good, good, good work. Thank you!!!memberwaxon1715 Feb '05 - 21:44 
I think I'd like to fix the tables issues because they are very important for data-driven applications. Don't worry about it, I'll send you an URL with the changes. Next week (I hope) I'll have finished the fixes and the ASP.NET code.
 
OpenOffice is cool. Now has some very good improvements. The 2.0 beta is so impressive. My personal oppinion is that Ms Officce is still better than OpenOffice but... OpenOffice is free!!!... and works!!!Big Grin | :-D
 
Best regards.
GeneralRe: Really good, good, good work. Thank you!!!memberBuffalo Charmer18 May '05 - 7:59 
Is it possible to configure this system to print in Landscape orientation?
I didn't see anything about configuring that.
Thanks,
C
 
~`^%
Generalvery nicememberTim Kohler3 Aug '04 - 4:39 
Super job. It's obvious that you put a lot of thought and effort into this. thanks for the great article!
GeneralIt shouldn't say...memberAaron Eldreth22 May '04 - 2:41 
Your article said:
Have you tried to print HTML documents? Have you tried to format your HTML documents for printing, with specific fonts, sizes, headers, footers, and margins?
 
If you have, then you know that HTML is not appropriate for printing - but you can find other formats and use new tools to convert HTML documents into Microsoft Word format, a format suitable for printing... And this is what this article is about.

 
Well, the answer is yes, I have tried printing HTML documents. I have formatted HTML documents to print with the fonts, sizes, headers, etc. etc. It's really not all that hard to do. Just use CSS-Print Media.
 
All-in-all though, it is some nice code, and your article is good.
 
Aaron Eldreth
TheCollective4.com
My Articles
 
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
GeneralCSS Print Media / Headers???memberEmmanuel Kartmann22 May '04 - 3:18 
Thanks for your comments - glad you liked the article and code.
 
Regarding CSS Print Media, can you elaborate on how to print a specific text (and format - like bold/verdana for example) in a header and a footer?
 
I mean - programmatically, not by changing the browser options (NO "File/Page Setup..." allowed). This is what ScriptX does, but it's an ActiveX (I can't use it in some environments/browsers)...
 
I'm aware of CSS3 Paged Media (http://www.w3.org/TR/css3-page/) but it's much too new for my IE6... (W3C Candidate Recommendation 25 February 2004)
 
E.

GeneralRe: CSS Print Media / Headers???memberAaron Eldreth23 May '04 - 8:57 
Emmanuel Kartmann
Regarding CSS Print Media, can you elaborate on how to print a specific text (and format - like bold/verdana for example) in a header and a footer?
 
I see now. You were talking about the actual "header" and "footer" of the printed page! My bad, I originally thought you were speaking of the HTML header tags (i.e., <h1>, <h2>, ...). Sorry 'bout that.
 
You are correct, there is no way (currently) to control the header and footer of the printed page without ActiveX controls. I now understand what the purpose of your code is. Thanks for clarifying.
 
Aaron Eldreth
TheCollective4.com
My Articles
 
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
GeneralIt shouldn't say...memberParlock21 May '04 - 9:27 
HTML when HTML and XHTML are different beast. XHTML has to conform to the XML specification to be a valid document. Which means tag nesting and open close tags have to be in conformance. Where as HTML doesn't have to have the tags in conformance with the XML specification.

GeneralRe: It shouldn't say...memberEmmanuel Kartmann23 May '04 - 20:20 
As Rui Dias Lopes said (see his posting), you can use tools to convert/normalize your HTML document before calling the XHTML2RTF tool (HTMLTidy does that, is freeware, and there is a library available in C/C++).
 
HTML => XHTML => RTF.
 
Magic.
 
E.
GeneralRe: It shouldn't say...memberParlock24 May '04 - 11:40 
Sorry I guess I wasn't saying it clear enough. At the top of your article it says, "This article describes a conversion tool which takes an HTML document as input and generates a Microsoft Word document for printing". When it should say XHTML document as you don't support HTML documents unless they have been converted into XHTML via some other tool, such as tidy..
 
Its a little miss leading in that you stated HTML document conversion when it doesn't in fact do HTML documents only XHTML..
GeneralNice concept but...sussAnonymous21 May '04 - 2:29 
Office 2000 and beyond have native support for XML...
 
Create word doc, do Save As, pick XML.
 
Open the XML file with Word and you will get your original document.
 
Also all the schemas are posted here for MS office products:
 
Too bad you spent all that time on that thing you did... funny to see some people dont do homework.
 
Here is a quite old link for dumping Excel XML out in ASP... obviously a .NET based solution would be even better:
 
http://support.microsoft.com/default.aspx?scid=kb;EN-US;285891

GeneralRe: Nice concept but...memberEmmanuel Kartmann21 May '04 - 2:51 
Hello M. Anonymous!
 
Did you read the article at all? The tool is for a software where you already have HTML generated from a MySQL database. Then you want to print your HTML - with header, footer, page numbers and stuff...
 
Of course, you can develop 2 versions of your code - one for HTML (online viewing) and one for Word/RTF (printing); but this is not very cool for maintenance cost.
 
In addition, some people (yes!) still struggle with older Word/Office versions (Office 2000 - really??). RTF is much older than this...
 
The tool just takes your HTML and converts it into RTF - something other tools can do (but not for free!).
 
Thanks for your interest in my homework Smile | :)
 
Regards,
 
E.

GeneralRe: Nice concept but...memberHuwJones27 May '04 - 23:03 
If you don't want to use word ?
 
Your sarcasm and arrogance is quite unpleasnat.
GeneralRe: Nice concept but...memberEmmanuel Kartmann27 May '04 - 23:14 
Extract:
 
... and besides some good tools to print HTML (HTML Print from Bersoft, ScriptX from MeadCo), ...
 
You could use these tools instead. They're pretty cool (and free/cheap).
 
I'm too old for homework - thus my tone. I didn't mean to sound so harsh, but I did. I'm truly sorry about that.
 
Regards,
 
E.

GeneralRe: Nice concept but...memberHuwJones27 May '04 - 23:21 
E.
 
Sorry about that, My comment was meant for 'Anonymous' - not you, but I replied to the wrong message.
 
'Anonymous' clearly thinks that his needs are the only ones worth considering.
 
H
GeneralRe: Nice concept but...memberEmmanuel Kartmann27 May '04 - 23:26 
My mistake - but I did replied harshly Wink | ;-)
 
E.

GeneralRe: Nice concept but...memberrht3417 Jan '06 - 5:49 
I may be mistaken, but I don't think XML support is in Office 2000; it is in Office 2002 and 2003.
GeneralExcellent work and...memberRui Dias Lopes18 May '04 - 9:41 
You can pipeline HTMLTidy[^] just before the XSLT processing, this way you can reach a greater audience Smile | :)
 
Got my 5!!
 
is this a sig?
GeneralDownload link is brokenmemberAlexY18 May '04 - 9:37 
The source code link is broken for me.
GeneralRe: Download link is brokenmemberEmmanuel Kartmann18 May '04 - 10:17 
Download link was broken because I couldn't upload files to the Codeproject web site earlier today!
 
Everything should be fine by now:
 
http://www.codeproject.com/useritems/XHTML2RTF/XHTML2RTF_src.zip
 
E.

GeneralRe: Download link is brokenmemberwerwiewas12 Dec '04 - 7:21 
Emmanuel Kartmann wrote:
Everything should be fine by now:
 
No, I am sorry, this link stiil don´t works.
 
Regards
_____
Arne
GeneralRe: Download link is brokenmemberEmmanuel Kartmann12 Dec '04 - 10:24 
Well it works for me... Maybe the server was down when you tried...
 
Can you try again?
 
If it doesn't work I may email the project to you.
 
Regards,
 
E.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 29 Dec 2005
Article Copyright 2004 by Emmanuel Kartmann
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid