Free Support Forum - groupdocs.com

Document viewer (UI rendering) in Java

Dears ,

As per Suggest from your sale department to ask below question in support Forum ,
It has to be noted that we would not be using the viewer(UI renderer) provided in the package as it is based on JSP and our application is based on JSF, if there are any implications doing so vendor needs to inform beforehand ?

Regards,
Elnour .

@eelnour

First thing to note is, GroupDocs.Viewer for Java is a UI-Agnostic API that could be integrated in any Java application irrespective of framework. For example we have developed some open-source applications for Java Spring and Java Dropwizard.
The core feature of API is to just render the source file in Image, HTML or PDF formats (depending on user’s business needs). Later, these rendered files could be displayed in the browser or any application (e.g. desktop).
Have a look at this code:

 String outputDirectory = "output directory path";
 String pageFilePathFormat = new File(outputDirectory, "page_{0}.png").getPath();

 PngViewOptions viewOptions = new PngViewOptions(pageFilePathFormat);

 Viewer viewer = new Viewer("source file.docx");
 viewer.view(viewOptions);
 viewer.close();

In this code, we are rendering a DOCX file to PNG images. And we are also specifying the output path for these PNGs. Once the rendering is done, you have to develop your own logic to pick PNGs from the output path and display in the browser. For this purpose you can use any JS/client side frameworks.

Thank you for quick reply . Got it .

Regards ,
Elwalied .

@eelnour

You’re welcome.