Page 1 of 1

PDF Viewer in VL Web

Posted: Thu Jul 27, 2017 8:27 am
by caseywhite
I see that someone asked about showing PDFs in VL web. The response seemed to indicate that you can't download the PDF and show it.

In looking at this from the help it shows that you can show a PDF if you can provide a URL.
http://docs.lansa.com/14/EN/lansa016/PRIM_WEB.Page.htm

The issue is that these would be secure documents that will only display if the SRVROUTINE returns the PDF so I would have to have a special URL. But I am guessing it still won't work because the URL response would be a document which won't necessarily show in the web browser control on my page. I suspect it may just try to download it.

Just wondering if anyone has come up with anything since? Would a widget the implements some other PDF viewer for the web work?

Trying to determine options and which one might be best. The simplest option would seem to be the user clicks on the button to save and we simply let the browser download it. The browser will then do what it wants. But then the user doesn't get the nice experience of having the PDF simply framed in for them them to view with an option to save.

Thoughts?

Re: PDF Viewer in VL Web

Posted: Thu Jul 27, 2017 9:47 am
by MarkD
The VLF-ONE shipped Upload/Download demo, in example 3, shows loading various files as a BLOBs and then sending them as a response.
The client side code ins in DF_T68H3O and the server module is in DF_T68DSO.
It's interesting that the example notes that this way of delivering a file and then imbedding it into your VL-Web page does not work in IE or Edge.
Is that the type of problem you are referring to?

Re: PDF Viewer in VL Web

Posted: Wed Aug 02, 2017 1:24 am
by caseywhite
Thanks Mark. That is what I am looking for but the problem is that IE is not supported. Web site will be public so it won't be possible to tell users not to use IE. Most sites just seem to have you click on the PDF and it gets downloaded though but I do like the idea of being able to view the PDF inline. Just doing some research to see what the best options might be.

Re: PDF Viewer in VL Web

Posted: Wed Aug 02, 2017 2:09 am
by dhnaigles
Casey
I received an idea from Paul Odle regarding displaying PDFs in a PRIM_WEB control using google docs. This does not initially download the pdf to the device, but uses the URL to display the PDF and allow it to be manipulated.

#path_including_http_of_document := "http://www.mywebserver.com/documents/pdfdocument.pdf"
#web_page_control.source := ( ("https://docs.google.com/gview?embedded=true&url=" + #path_including_http_of_document) )

Re: PDF Viewer in VL Web

Posted: Wed Aug 02, 2017 2:21 am
by caseywhite
Thanks David.