Page 1 of 1

Mozilla pdf.js for showing pdf files

PostPosted: Fri Jan 24, 2014 4:02 pm
by deezzub
Is it possible to use the Mozilla pdf.js in Servoy for showing PDF files? If yes, what is the best way to integrate it in Servoy?

Re: Mozilla pdf.js for showing pdf files

PostPosted: Mon Jan 27, 2014 12:36 am
by mboegem
web or smart-client?

Re: Mozilla pdf.js for showing pdf files

PostPosted: Mon Jan 27, 2014 10:09 am
by deezzub
mboegem wrote:web or smart-client?

Smart Client, but in Web Client it should also work.

Re: Mozilla pdf.js for showing pdf files

PostPosted: Mon Jan 27, 2014 10:48 am
by pbakker
PDF.js works in svyJFXWebView, albeit slowly. I guess the WebKit version underlying the JavaFX WebView component that is wrapped in svyJFXWebView doesn't have the JavaScript performance optimizations yet to make it fast (same issue as when using PDF.js in some (somewhat) older browsers)

Wrapping PDF.js in such a way that you can easily use it in both the Smart and Web Client is exactly what svyComponent was created for. Better to wait a couple of weeks before digging into that through, because the documentation for svyComponent is not yet available.

Paul

Re: Mozilla pdf.js for showing pdf files

PostPosted: Mon Jan 27, 2014 10:57 am
by mboegem
deezzub wrote:Smart Client, but in Web Client it should also work.


pdf.js is using a HTML5 canvas to draw the pdf.

Because by default Java is not capable of showing this kind of advanced HTML, the smart-client is not able to do this when running with Java 6 .
In that case you need to use the jPedal bean which can preview PDF's.
Smart-clients using Java 7 can benefit of the recently exposed open source module 'svyJFXWebView'. (viewtopic.php?f=68&t=20132),
but will also be able to use the jPedal bean

In web client it should be possible to use the pdf.js by injecting the code.
The only restriction you'll have is the browser, which should be capable of displaying this kind of HTML5 content.
Using the jPedal bean is not possible here.

Re: Mozilla pdf.js for showing pdf files

PostPosted: Fri Jan 31, 2014 5:23 pm
by deezzub
Thanks Paul and Marc, for your informations. I try it. We are looking for a jPedal alternative, because of the error: java.lang.ClassNotFoundException.