Month: December 2019

Foxit PDF Reader on Linux with Wine

I don’t very much like Evince or other FOSS PDF readers on Linux. I do however like using Foxit on windows. They do actually provide packages for Linux packages but there is a long standing rendering bug where everything is super stretched out vertically. There does not seem to be an solution to the bug in sight. However, while perusing the support forums someone mentioned they had good success using the Windows version in Wine. Ok! Fine.

I want this to be separate from the Wine root in my home directory so it is self contained and can be copied from one machine to another. I’m lazy.

mkdir -p /opt/foxitwine/wineroot
cd /opt/foxitwine/
<wget your foxit installer .exe in here>
WINEPREFIX=/opt/foxitwine/wineroot wine FoxitReader97_Setup_Prom_IS.exe

Now install Foxit Reader, I put it in c:\FoxitReader for brevity.

Thing is, you want this to integrate nicely with your Linux desktop, so, here’s a FoxitReaderWine.desktop file:

[Desktop Entry]
Name=Foxit Reader Wine
Comment=View pdf documents
Keywords=pdf;ppdf;
StartupNotify=true
Terminal=false
Type=Application
Categories=Application;Office;Viewer;X-Red-Hat-Base;
MimeType=application/pdf;application/ppdf;
Icon=FoxitReader
Exec=/usr/bin/env bash -c "printf 'z:%%q\\n' %F | WINEPREFIX='/opt/foxitwine/wineroot' xargs wine 'C:\\FoxitReader\\FoxitReader.exe'"

I was having an issue with getting the file argument successfully passed to wine so I mined this discussion for a handy solution.

mv FoxitReaderWine.desktop /usr/share/applications/

All done.