Foxitreader URL launch fix

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
ozsouth
Posts: 858
Joined: Fri 01 Jan 2010, 22:08
Location: S.E Australia

Foxitreader URL launch fix

#1 Post by ozsouth »

*** Edit 17/2/11 (http fix is OK; www fix needed amending) ***

Foxitreader is a great pdf reader - can open embedded URLs. Default result in Puppy was to launch default text editor instead of browser. Other distros didn't have that trouble. Problem is in /usr/local/bin/defaulthandler.

Remove lines 6-8:

Code: Select all

if [ "`echo -n "$AFILE" | grep '\.'`" = "" ];then
 #/usr/local/bin/defaulttexteditor "$1"
 exit

Replace with:

Code: Select all

if [ "`echo -n "$1" | grep 'http:'`" ];then
 /usr/local/bin/defaultbrowser "$1"
exit
fi
if [ "`echo -n "$1" | grep 'www.'`" ];then
 /usr/local/bin/defaultbrowser "http://""$1"
exit

URLs now open the browser. Nothing else appears to be affected.
Last edited by ozsouth on Thu 15 Mar 2012, 21:34, edited 1 time in total.

In the Doghouse

Foxit URL launch fix

#2 Post by In the Doghouse »

To ozsouth about the URL launch fix, THANK YOU!

I tried this, and it got FoxitReader reading embedded URLs, just as promised.

The bonus is that it also resolved my problem with TrueCrypt, which would take Help menu URLs, and launch an empty geany text editor window. (only remaining TrueCrypt Help menu problem is that the TrueCrypt User's Guide.pdf tries to be imported from postscript (?) into GIMP, instead of just going into Foxit. Had to replace gimp-2.6 executable with a script of the same name, that looks for the TrueCrypt launch of GIMP, and replaces it by calling Foxit:

Code: Select all

#!/bin/sh
if [ "`echo -n "$1" | grep 'TrueCrypt'`" ]; then
 /usr/local/bin/FoxitReader "$1"
exit
fi
exec gimp-2.6ORIG
[Syntax borrowed from ozsouth's URL fix script]

This works, but would love to know why Puppy calls GIMP for a PDF launch)

Michalis
Posts: 237
Joined: Tue 08 Jan 2008, 14:50
Location: Greece

#3 Post by Michalis »

Great fix ozsouth.

Works also for transmission, probably for other programs too. I have suggested it also to Barry at his blog.

User avatar
Barkin
Posts: 803
Joined: Fri 12 Aug 2011, 04:55

#4 Post by Barkin »

HTTPS links in PDFs don't work for me in Foxit (with FireFox 7),
all HTTPS hyperlinks clicked on in Foxit in my Puppy 525 are redirected to www.homeimprovement.com

I've attached a test PDF (in zip file) with HTTP and HTTPS links, (made in Open Office).

[Both the HTTP and HTTPS links in the attached PDF work OK in Adobe reader in Windows Vista].
Attachments
PDF with HTTPS hyperlink, a test for Foxit in Puppy.zip
PDF in ZIP file
(30.56 KiB) Downloaded 395 times

ozsouth
Posts: 858
Joined: Fri 01 Jan 2010, 22:08
Location: S.E Australia

Foxitreader Quick Fix

#5 Post by ozsouth »

Referring to initial post, removing the colon after the first http (in /usr/local/bin/defaulthandler) is the quick fix. I now use Racy 522 & its Epdfview opens weblinks, but the same version doesn't in Puppy 525/528/529.

Post Reply