Code

Import. dEPSCrop option added to EPS to PDF convertion (Bug #649842: import from...
authorJazzyNico <nicoduf@yahoo.fr>
Fri, 8 Oct 2010 12:42:42 +0000 (14:42 +0200)
committerJazzyNico <nicoduf@yahoo.fr>
Fri, 8 Oct 2010 12:42:42 +0000 (14:42 +0200)
share/extensions/eps_input.inx
share/extensions/ps2pdf-ext.py

index 14f33764db3507100c5b842e8e9b2faeabf7a03d..411d82cd8b0321417967269232efbb0f17c554d1 100644 (file)
@@ -5,6 +5,7 @@
     <dependency type="extension">org.inkscape.input.pdf</dependency>    
     <dependency type="executable" location="path">ps2pdf</dependency>
     <dependency type="executable" location="extensions">ps2pdf-ext.py</dependency>
+       <param name="dEPSCrop" type="boolean" gui-hidden="true">true</param>
     <input>
         <extension>.eps</extension>
         <mimetype>image/x-encapsulated-postscript</mimetype>
index d3bc3d052776452470060492a54af7fed22e5f3d..3d137e9b4d220b7eb9966133711e08cec47f055e 100644 (file)
@@ -24,6 +24,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 import sys
 from run_command import run
 
-run('ps2pdf "%s" "%%s"' % sys.argv[1].replace("%","%%"), "ps2pdf")
+cmd = 'ps2pdf'
+if (sys.argv[1] == "--dEPSCrop=true"): cmd += ' -dEPSCrop '
+
+run((cmd+' "%s" "%%s"') % sys.argv[-1].replace("%","%%"), "ps2pdf")
 
 # vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 encoding=utf-8 textwidth=99