Bug 691947 - Patch to allow external commands
Summary: Patch to allow external commands
Status: RESOLVED DUPLICATE of bug 691330
Alias: None
Product: MuPDF
Classification: Unclassified
Component: apps (show other bugs)
Version: unspecified
Hardware: PC Linux
: P4 normal
Assignee: Tor Andersson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-09 19:25 UTC by Daniel Wagenaar
Modified: 2011-04-10 13:53 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
Patch to allow external commands (2.14 KB, patch)
2011-02-09 19:25 UTC, Daniel Wagenaar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
daw@caltech.edu
(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 ***