Thanks for taking interest in GroupDocs APIs.
Please note that all the APIs at GroupDocs are back-end APIs that provide the wide range of features for document manipulation. The APIs do not provide any built-in UI or control that can be embedded in your front end application. You can easily use any Java or .NET API in your ColdFusion application by including the API’s JAR or DLL.
GroupDocs.Viewer provides the feature of rendering the document pages in the form that can be displayed easily in your front end application. The API provides the following modes to render a document.
Html based rendering: In Html based rendering, the API generates the Html representation of each page of the source document. You can easily manipulate the Html content of each page as a string. You can either embed the HTML content directly in your application or save it as an HTML file and display it in the browser.
Image-based rendering: In image-based rendering, the API converts each page of the document into an image (PNG, JPG, BMP). You can easily save the image to your desired location and display it in your application to view the content of the document.
Following code snippet shows how to get HTML representation of a Word document using GroupDocs.Viewer for Java in ColdFusion.
viewerConfig = createObject("java", "com.groupdocs.viewer.config.ViewerConfig");
HtmlOptions = createObject("java", "com.groupdocs.viewer.converter.options.HtmlOptions");
ViewerHandler = createObject("java", "com.groupdocs.viewer.handler.ViewerHtmlHandler").init(viewerConfig);
list = CreateObject( "java", "java.util.ArrayList" ).Init();
list = ViewerHandler.getPages("calibre.docx", HtmlOptions);
// getPages retuns list of the PageHtml. You can loop through the list to get HTML content of each page of the document and save it as HTML file or display it in the web page (as shown below using cfoutput tag).
<cfloop from="1" to="#arraylen(list)#" index="x">
Please make sure that GroupDocs.Viewer.jar file is placed in …\WEB-INF\lib\ folder.
You can also explore more about GroupDocs.Viewer API by referring to the following documentation.