Opening PDF file in SWT Browser - XulRunner default viewer

921 views Asked by At

Situation:

  1. My RCP application uses XulRunner
  2. System has two installed PDF viewers (Acrobat, Gimp)
  3. Firefox has Gimp set as default viewer
  4. I want to make my SWT Browser composite in RCP application ignore default viewer and use Acrobat if it is installed
  5. If it is not, I want to use default viewer

Question:

  1. Can I achieve this by (temporarily) setting some XulRunner or System property in my application?
2

There are 2 answers

1
Tejas Unnikrishnan On

You can create a Process in Java and execute the below command line to open PDFs in Adobe Acrobat Reader forever.

start "" /max "ExecutablePathAdobeAcrobat.exe" /A "pagemode=FullScreen" "PDFFilePath.pdf" 
0
SomeDude On

Check this link : https://support.mozilla.org/en-US/kb/disable-built-pdf-viewer-and-use-another-viewer

I am pretty sure there should be a way to codefully disable the gimp or whatever built-in app the firefox uses. you might need to use some APIs that modify preferences in Firefox