Free Support Forum - groupdocs.com

HTML Content dimensions

Hi All,


I have a few questions on group docs viewer for JSP:

  • Is there a way to control the dimensions of the html content generated by Group Docs? The dimensions of the html content varies based on the document used as input. In some cases, the document stretches beyond the screen and there is a horizontal scroll bar.
  • Can I change the controls in Groupdocs for JSP to show the controls present in Servlet, Struts option? In the Groupdocs version for Servlet and Strut, I see that Images are used. In our case, we plan to only use Html content. Is there any documentation available that tells me how to integrate the HTML content with the look feel of Group docs available for Servlet/Strut option
  • In case if we use the image option to display content, is there a way to restrict the option to save images on the browser.
Regards
Chetan Mahendru

Hi Chetan,


Thanks for taking interest in GroupDocs.Viewer for Java and showing your concerns.
Is there a way to control the dimensions of the html content generated by Group Docs?
Can you please share the problematic file/document with us, so that we can investigate your scenario? We’ll appreciate your cooperation.
Can I change the controls in Groupdocs for JSP to show the controls present in Servlet, Struts option?
We would like to apprise you that our showcase projects are open-source. Hence, you can change or add new controls in the existing JSP project. In fact, you can learn from our Struts2 or Servlets based projects about different controls and how they can be added.
In the Groupdocs version for Servlet and Strut, I see that Images are used. In our case, we plan to only use Html content. Is there any documentation available that tells me how to integrate the HTML content with the look feel of Group docs available for Servlet/Strut option
What we understand from your question is, you want to implement HTML based viewer (render input document as html). You can achieve your intention by setting useHtmlBasedEngine to true in index.jsp file of Servlets based or struts2 project.
You may find following resources helpful:
GroupDocs.Viewer for Java Servlets Based Project
GroupDocs.Viewer for Java Struts2 Front End
Finally, you can render documents as HTML (as explained earlier how to do that) and you can restrict the option to save rendered document on the browser (demonstrated in JSP project).
Please share if you have any further issues. We are always here to help you out.

Kind regards

In case if we use the Servlet look and feel, how do we disable the browse option. We will like to ensure that the group viewer only displays one document.

Hi Chetan,


how do we disable the browse option
It’s quite easy to disable file browse option in our Servlets based showcase project. Please follow the following steps:
  1. Open index.jsp file
  2. Set showFolderBrowser : false
  3. Update/Re-run project
Please find the attached screenshots/output (Before and after disabling the file browse control).

We will like to ensure that the group viewer only displays one document.
Yes, you can display a default document and user won’t be able to open/display any other document/file. You just need to set your default document/file in index.jsp file as filePath : ‘demo.docx’ and disable file browse control as mentioned earlier.

Hope you can achieve your intention in this way.
Many Thanks
Is there any option to get DocumentInfo from input stream using java in doc viewer? Below is the snippet which accepts String path/filename.

DocumentInfoContainer docInfo = null;
try {
docInfo = ViewerUtils.getViewerHtmlHandler().getDocumentInfo(new DocumentInfoOptions(path));
} catch (Exception x) {
throw new ServletException(x);
}​

Another question is about pdf file showing in html format


I used the below pdf in the showcase example GroupDocs.Viewer-for-Java-using-Servlets

http://www.pdf995.com/samples/pdf.pdf

First page of the given PDF has some missing content(see the attached screenshot PDF_partial.jpg). Expected is also attached(Expected.jpg).

Could you please check this issue?



Hi Girisankar,


Is there any option to get DocumentInfo from input stream
Yes, you can achieve your intentions using GroupDocs.Viewer for Java 3.7.0. We also have prepared essential resources for you. Please go through the following documentation.
Get Document Information by Stream - Documentation

Kind regards

Hi Again,


Another question is about pdf file showing in html format
This questions is answered here.

Thanks