From 61b4f8733013c50c5e36c6ec3c964fdbfcb7a794 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Tue, 6 Feb 2007 23:44:43 +0000 Subject: [PATCH] Fix bug 2418 (hopefully) * lib/configure.py: Check whether convert understands the -define option, and, if so, define a new converter PDF->PNG such that the CropBox rather than the MediaBox is used in the conversion. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17078 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/configure.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/configure.py b/lib/configure.py index d62d3aab65..b8629cf034 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -8,7 +8,7 @@ # \author Bo Peng # Full author contact details are available in file CREDITS. -import sys, os, re, shutil, glob +import sys, os, re, shutil, glob, commands class Tee: @@ -406,6 +406,13 @@ def checkConverterEntries(): checkProg('an EPS -> PDF converter', ['epstopdf'], rc_entry = [ r'\converter eps pdf "epstopdf --outfile=$$o $$i" ""', '']) # + path, convert = checkProg('a PDF -> PNG converter', ['convert']) + if convert != '': + # check whether convert supports the -define option + conv_opts = "-define pdf:use-cropbox=true -depth 8" + if not 'Unrecognized' in commands.getoutput('convert ' + conv_opts): + addToRC(r'\converter pdf png "convert %s pdf:$$i png:$$o" ""' % conv_opts) + # checkProg('a Grace -> Image converter', ['gracebat'], rc_entry = [ r'''\converter agr eps "gracebat -hardcopy -printfile $$o -hdevice EPS $$i 2>/dev/null" ""