Bug 691947

Summary: Patch to allow external commands
Product: MuPDF Reporter: Daniel Wagenaar <daw>
Component: appsAssignee: Tor Andersson <tor.andersson>
Status: RESOLVED DUPLICATE QA Contact: Bug traffic <tech>
Severity: normal    
Priority: P4 CC: daw, dsdutkiewicz
Version: unspecified   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---
Attachments: Patch to allow external commands

Description Daniel Wagenaar 2011-02-09 19:25:11 UTC
Created attachment 7227 [details]
Patch to allow external commands

The attached patch adds a new keystroke, "!", to mupdf version 0.7 to run external commands. The first external command is defined in the environment variable "MUPDF_EXTERNAL". By giving the keystroke a numeric prefix, additional external commands may be used. For instance "3!" would run the command defined in environment variable "MUPDF_EXTERNAL3".

As an example of use, you could set "MUPDF_EXTERNAL=lpr" and "MUPDF_EXTERNAL1="pdfdraw". Then, "!" would print the currently loaded file, and "1!" would export its pages as images.

Hope this is helpful,

Daniel Wagenaar
Daniel Wagenaar
California Institute of Technology
1200 E. California Blvd. 216-76
Pasadena CA 91125
(626) 395-2577
Comment 1 Daniel Dutkiewicz 2011-02-14 21:06:06 UTC
this patch's addition of app->filename is similar to my own but i've got a lot more changes and it's a bit less well written 

i'll submit my changes in another bug. that is bug #691965

the main issue is that you need to turn the filename into absolute path via realpath as when mupdf is called like mupdf somename.pdf which i commonly do if i'm opening from the command line (although i do prefix it with 'detach' or as i have it aliased 'd') the filename will not be absolute
Comment 2 Tor Andersson 2011-04-10 13:53:15 UTC

*** This bug has been marked as a duplicate of bug 691330 ***