I had to use the SWT.MOZILLA flag with the browser since PDFJS did not run with GTK webkit (Linux native) and Internet Explorer (Windows native).
The application has to be shipped with XulRunner 24.0 which is compatible with the SWT library.
With the old PDFJS version 1.2.109 this worked fine.
For testing I switched to current stable PDFJS 1.4.20. Unfortunately lots of images are not rendered anymore.
I believe that the outdated XulRunner version is the reason. I tried to find out if there is support for a newer one in the Eclipse Neon platform.
The XulRunner project is deprecated and there is no effort in the Eclipse team to get the latest version working with SWT. This is bad news.
For now XulRunner has to be used and shipped with the SWT application to get a stable PDFJS integration.
The follwing table summarized the test results.
Eclipse: Neon 4.6, Build I20160606-1100
SWT: I found two jars in the plugins folder:
SWT.getVersion() returns 4623
|OS||SWT Browser flag||Browser||PDFJS||Result|
|Windows 7||SWT.NONE||IE 11||All versions||PDF is not rendered|
In standalone IE 11 PDF 1.5.188 works but not embedded in SWT
|XulRunner 31||1.2.109||Not tested|
|Ubuntu 14.04.1||SWT.NONE||GTK WebKit||1.2.109||PDF is not rendered|
|GTK WebKit||1.4.20, 1.5.188||PDF rendered but VM crashes when resizing browser widget|
|SWT.MOZILLA||XulRunner 24||1.2.109, 1.5.188||OK|
|1.4.20||Rendered but images missing|
|XulRunner 31||All versions||Browser widget cannot be created. Known bug.|
|Windows 10||Not systematically tested yet. SWT.MOZILLA + XulRunner 24 + PDFJS 1.2.109 works|