groupdocs-viewer / GroupDocs.Viewer-for-Java-Spring

Moved to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Java/tree/master/Demos/Spring
https://products.groupdocs.com/viewer/java
MIT License
9 stars 5 forks source link

Params URL #40

Closed erjezus closed 4 years ago

erjezus commented 5 years ago

Forum: https://forum.groupdocs.com/t/params-url/7489/2

I need to load a document in the viewer by passing the name of the document in the url. The documentDefault parameter is static and I need to change it dynamically.

I need to go through the URL the name or path of the document to display or set the documentDefault attribute. Could you tell me how? Thanks

egorovpavel commented 5 years ago

Hi @erjezus. As far as I understand, you want to customize viewer in a way that it will be able to open a document using some kind of identifier passed in URL. I prepared an example of this use case in a separate branch (also check out what was added/changed).

This example expects to receive a URL of the document in a query string. EX:

http://localhost:8080/viewer/?url=https://calibre-ebook.com/downloads/demos/demo.docx

then it downloads this file to a server and opens it in Viewer.

You can modify constructor logic to fit your use case. For example, instead of using URL to download and open a downloaded file you can use another identifier or filename to open files you already have at your server.

Let me know if this solution works for you.

erjezus commented 5 years ago

Hello, I am deploying the application with the war profile with finalName viewerDocument. Currently I get this error when starting.

ERROR

Thanks.

egorovpavel commented 5 years ago

@erjezus by default we assume that API located at http://localhost:8080. In order to change this to your custom endpoint simply modify this line

egorovpavel commented 5 years ago

Hi @erjezus, Let us know if this solution works for you and we can close this issue.

erjezus commented 5 years ago

Hi, the solution works correctly. But I need the viewer options bar too. Also if the document contains a URL as hyperlink does not work.

mjim79 commented 5 years ago

Hi @egorovpavel,

Any update regarding this issue? We are waiting for two issues:

  1. The final solution with the viewer options bar.
  2. If a document contains an URL as hyperlink, the link doesn’t work.

Thank you!

egorovpavel commented 5 years ago

Hi @erjezus. The provided branch was intended to showcase the way to customize the behavior and appearance of the GroupDocs.Viewer application. I updated this branch and reverted to the original view and stylings.

In case you need to customize the original appearance just edit files related with custom component https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Java-Spring/tree/custom-viewer-example/client/apps/viewer/src/app/custom-viewer

Regarding the issue with the links in the document I was unable to reproduce this issue, please provide a document where we can reproduce this issue.

FYI @mjim79

erjezus commented 4 years ago

These two documents contain url, the viewer shows them as text. We have performed tests even with the test viewer (https://products.groupdocs.app/viewer)

Files.zip

egorovpavel commented 4 years ago

Hi @erjezus, I tried both files and was able to view and click on links image

Make sure that you are using correct rendering mode (htmlMode = true) in configuration.yml

Viewer configuration options

erjezus commented 4 years ago

Hi @egorovpavel , Try the following pdf document please. In the configuration it is defined as html. Thanks.

imagen

HIPERLINK.pdf

egorovpavel commented 4 years ago

@erjezus Please try in the latest version of GroupDocs.Viewer.

koleslena commented 4 years ago

Hi @erjezus , the problem was reproduced in the lastest version of groupdocs-viewer, so we reported the bug for groupdocs-viewer team.

koleslena commented 4 years ago

Hi @erjezus , I added fix for rendering links from pdf files. Please, try the latest version.