This content has been marked as final. Show 8 replies
I'm not aware of a native CF method for working with Word files. You might try the Java version of Aspose.Words.
It seems it can convert word to html platform independent. The issue here is we need to convert the uploaded word file at run time.
Originally posted by: Mr Th
it can convert word to html platform independent.
For clarification what does "it" refer to, ColdFusion or Aspose.Words?
"it" refers to Aspose.Words
The issue here is we need to convert the uploaded word file at run time.
Can you describe the workflow you have in mind?
Yes. I can.
1) We have a form which allows the user to upload word (.doc) file.
2) When the user submits the form, word file will be uploaded to a directory in the server. Say now we have test.doc in the server
3) we need to convert the test.doc into test.html
The last stage seems to be a daunting task.
Once again we are on Unix environment.
For step 3 call a 3rd party component such as Aspose.Words to handle converting test.doc to test.html. I'd recommend wrapping this logic inside a CFC.
For example using Aspose.Words java object appears to be as easy as the Java code:
Document doc = new Document(getMyDir() + "Document.doc");
doc.save(getMyDir() + "Document.ConvertToHtml Out.html", SaveFormat.HTML);
Note: I've used the .NET version of Aspose.Words, not the Java version, but I've been pleased with the product.
Aspose.Words formats supported
You might also investigate Apache POI
See quick and dirty sample of how using a java object might work for you. Note that this code is not tested. I'm not a java expert so if anyone sees a problem with my sample please share your thoughts.