• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

HTML to Word or PDF to Word

Community Beginner ,
Mar 14, 2008 Mar 14, 2008

Copy link to clipboard

Copied

Are there any components out there that will allow us to get HTML content into Word format? Or, since we can generate PDF easily, PDF to Word format?

Thanks
Paul
TOPICS
Advanced techniques

Views

4.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 14, 2008 Mar 14, 2008

Copy link to clipboard

Copied

Hi Paul
Some ideas to generate a word document:

- write html code after <cfcontent type="application/msword">, the easy way

- Use the HWPF Java Classes of the Apache POI Project. I don't know if there is a Coldfusion Component to handle that. I found one to generate Excel Sheets with Apache POI that is really great: http://www.bennadel.com/projects/poi-utility.htm

- Generate the word doc using com objects: http://tutorial13.easycfm.com/

I hope this helps...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 20, 2008 Mar 20, 2008

Copy link to clipboard

Copied

Apache POI project is ideal for Excel files but not perfect for Word generation.

I have tried one of the Java components from Aspose before.

Aspose.Word
http://www.aspose.com/categories/file-format-components/aspose.words-for-.net-and-java/default.aspx

But this is a bit complex process if you need to generate all from CF.

I also would suggest to check WordML technology. Documentation is a real pain but it is just basically a XML syntax which enables to generate Word files onfly.

Here is a nice guide for WordML
http://rep.oio.dk/Microsoft.com/officeschemas/wordprocessingml_article.htm

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 15, 2010 Mar 15, 2010

Copy link to clipboard

Copied

LATEST

This component can convert HTML to Word:http://www.sautinsoft.com/products/html-to-rtf/index.php

http://www.sautinsoft.com/products/html-to-rtf/images/htmltortf_box.jpg

This is a sample code:

  SautinSoft.HtmlToRtf h = new SautinSoft.HtmlToRtf();

        //here we specify page numbers
        h.PageNumbers = SautinSoft.HtmlToRtf.ePageNumbers.PageNumFirst;

        h.HtmlPath = Server.MapPath("");

        string rtf = h.ConvertFileToString(Server.MapPath(""), @Default.aspx);

        //show Word/rtf
        if (rtf != "")
        {
            Response.Buffer = true;
            Response.Clear();
            Response.ContentType = "aplication/msword";
            Response.AddHeader("Content-Disposition:", "attachment; filename=Test.doc");
            Response.Write(rtf);
            Response.Flush();
            Response.End();
        }

Or another sample to convert in memory:

SautinSoft.HtmlToRtf h = new SautinSoft.HtmlToRtf();

string word = h.ConvertString(htmlString);

  • Written in 100% managed C#
  • Absolutely standalone, doesn't require MS Office or any  dependencies
  • Can be used in C#, VB.Net, J#, Delphi.Net, ColdFusion
  • Works at shared-hosting servers with Medium trust  level, like a GoDaddy

Download complete functional trial: http://www.sautinsoft.com/components/htmltortf_pro_net.zip

Best wishes,

Max

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation