Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening PDF file in SWT Browser - XulRunner default viewer

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?
like image 774
Jan Hruby Avatar asked Jun 08 '15 14:06

Jan Hruby


People also ask

How do I change my default PDF viewer to open?

1. Right-click the PDF, choose Open With > Choose default program or another app in.

How do I change my default PDF viewer from chrome to Adobe?

Chrome. Open Chrome and type "about:plugins" into the omnibox at the top. Scroll down and find Chrome PDF Viewer. Click the "Disable" link to prevent PDFs from loading within Chrome.


1 Answers

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"  
like image 90
Tejas Unnikrishnan Avatar answered Sep 29 '22 18:09

Tejas Unnikrishnan