Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: 1 [2]
  Reply  |  Print  
Author Topic: Display PDF-Files in GDC  (Read 25228 times)
Leo S.
Four Js
Posts: 126


« Reply #15 on: November 14, 2016, 12:56:57 am »

Hi Snorri, I got it to work , but...
I would not actually recommend to use it.
Why?
We did prepare webcomponents in 3.00 to use build in transmission for the web components html/javascript/css assets to the client.
Unfortunately this transmission does not work for this particular component (its a bug, but a bug being deeply in QtWebKit, so we are unable to fix this easily),
the visual effect is that the html page is shown as source code instead of being rendered... I hope that we can fix that for vNext .
What does work is uploading all needed pieces via fgl_putfile() to the clients data dir and using the setwebcomponentpath frontcall...this implies however that all webcomponents using this particular program need to be uploaded.
You need to check also the assets needed for uploading: the sample works for US locale but for other locales you might need to upload additional assets.
I attach the solution here, as said, its not really nice and understandable due to the uploading hassles.
Note that the makefile is pretty OSX centric : it uses curl to download the pdfjs stuff, but it should be easily adaptable to Linux.
The core of the trick: a small patch implants a gICAPI.js in the main page and enables you to call the displayPDF JS function via a webco frontcall.
% make main.run
press the "show" button and it should show a little demo with a pdf file.

* wc_pdf.zip (11.11 KB - downloaded 746 times.)
Leo S.
Four Js
Posts: 126


« Reply #16 on: November 14, 2016, 01:33:45 am »

Small addition: the problem appears only if GDC is connected directly or via SSH with the server.
Going via GAS and loading the webcomponent via http does work flawlessly (btw it does work also for GWC-JS)
I updated the main.4gl and attach here (you see  the different ways are distinguished with the viaGAS variable)
Leo

* main.4gl (4.26 KB - downloaded 730 times.)
Snorri B.
Posts: 103


« Reply #17 on: November 14, 2016, 12:21:44 pm »

Thanks Leo.

I will look into this. Probably it's just easier to have it all server side. Too many things could go wrong on > 300 clients.

Regards,
-Snorri
Leo S.
Four Js
Posts: 126


« Reply #18 on: November 14, 2016, 12:58:31 pm »

Hi Snorri , I'd like to add that it would work anyway only for GDC3.00 , not 2.50 .
Regards, Leo
Snorri B.
Posts: 103


« Reply #19 on: November 14, 2016, 03:50:39 pm »

Hi Snorri , I'd like to add that it would work anyway only for GDC3.00 , not 2.50 .
Regards, Leo

Yes, I'm aware of that.

Thanks,
-Snorri
Pages: 1 [2]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines