Free Support Forum -

How to render a document in Spring Java application

I want to show single document upon loading of the viewer. can you help me how to do it.
We do not need to browse from list.


You can provide the absolute path of the document to the defaultDocument property in configuration.yml file.

But i need it at run time to change the default document. so can we pass document path while loading the viewer or after the viewer loaded. to call the loadDocumentDescription with document list right after viewer loaded


Could you please provide us some more details about the workflow of your requested feature and the expected output?

I have run the GroupDocs.Viewer-for-Java-Spring-1.14.25 using mvn clean spring-boot run. now the localhost:8080.viewer opening the page.
now the page shows the viewer with browse below
viewer_load_page.png (14.6 KB)
And then i hva eot select from document list and then the required document opens in viewer
after_document_page.jpg (195.9 KB)

Our requirement is to open any document by localhost:8080/viewer/documentname.
so that we do not want to show choose list of documents. one document selected from our UI and then we open viewer in iframe to show the document.

can you please upload simple folder structure with html, js and css files from which we can make changes on our own. everytime we need to make changes to UI we have to build the war. this is too much work to be done. for groupdocs java spring

please upload a simple process where simple folder structure is built and once the war file built we can update the files on our own choice.

we are in process of buying license from groupdocs but the process seems to be more time taking.


Thanks for sharing the details. Please have a look at this comment which provides a sample application and related details to deal with a similar use-case.

I am afraid that such a structure is not available. You may have a look at this commit to know about the changes required to customize the application on your own.

this is not working

setting default document also not working in groupdocs java spring with temporary license. please help quick.

The url one is required because if there are 3 users need to view different documents at same point if time. please help me fix it. the URL one


Please make sure that the file is accessible using the URL that you have provided in the query string. For example, you may try url= and it will display demo.docx. Alternatively, if your files are already located on your server, you can pass the file’s path in the URL param as url=file:///D:/storage/candy.pdf.

Furthermore, you can also customize the constructor logic in GroupDocs.Viewer-for-Java-Spring/client/apps/viewer/src/app/custom-viewer/custom-viewer.component.ts file to fit your use-case.

It was a known issue (filed as Issue #44) and has been fixed in the latest release of the front end.