I am trying to customize the groupdocs viewer code using CustomInputDataHandler class.I am using groupdocs-viewer-spring-slim( 2.5.0) version.
Objective: Physical documents are encrypted,need to decrypt while showing on group docs viewer.
Error: Code works for normal files but not working on encrypted files Shows “Exception” on groupDocs viewer. Can we check those exception on console?? Or how we can debug the exception?? Or any other way for achieving our objective??
check the below code snippet. =====================
You can check the exception when running the sample in the debug mode. Just place breakpoint in the InputDataHandler implementation methods and see where it occurs.
The InputDataHandler implementation to work correctly should provide as well the file description info. You need to implement the getFileDescription method except the getFile one.
Please, check if you correctly implemented all parts. If you still will have some problems, please provide us your or some test file so we can investigate your situation.
Strange, Mehul, just checked the sample again and on my side it runs ok with the changes you mentioned. I would ask you to archive all your project and attach to your post here so we can check it.
Guid - is the generated ID of the file. Actually there can be anything you want. But you should keep in mind that this value is transferred to the client JavaScript.
In the sample it is formed in the index method of the HomeController for the first file. For other files (which are handled through the file tree dialog) guids are retrieved from the InputDataHandler.
Thank you for the provided project. We’ve examined it and found few significant issues:
pom.xml file is incorrectly formed (probably because of the copy-paste typo) – you need to remove the duplicate build section and make sure the xml structure is formed correctly
I see you hard-coded some guids in the CustomInputDataHandler. I’ve changed it back to the original sample. These should be generic to function correctly.
As from your last chat contact we’ve understand that you are getting problems with loading files through GET parameters, like “http://localhost:8080/document-viewer?file=Document.pdf”.
This problem is caused by the difference of the file name encoding in the CustomInputDataHandler (when filling fileMap) and in the index (“/view”) HTTP handler. You can easily fix it just by changing the index method of the HomeController to set the initialFilePath like in the CustomInputDataHandler: