summaryrefslogtreecommitdiffstats
path: root/fedora_business_cards/export.py
diff options
context:
space:
mode:
Diffstat (limited to 'fedora_business_cards/export.py')
-rw-r--r--fedora_business_cards/export.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/fedora_business_cards/export.py b/fedora_business_cards/export.py
index baff368..7da871c 100644
--- a/fedora_business_cards/export.py
+++ b/fedora_business_cards/export.py
@@ -39,7 +39,7 @@ def svg_to_pdf_png(xmlstring, filename, format='png', dpi=300):
Export an SVG to either a PDF or PNG.
xmlstring = the SVG XML to export
filename = name of file to save as
- format = either 'png' or 'pdf'
+ format = either 'png', 'pdf', or 'eps'
dpi = DPI to export PNG with (default: 300)
"""
stdin = xmlstring.encode('utf-8')
@@ -55,6 +55,13 @@ def svg_to_pdf_png(xmlstring, filename, format='png', dpi=300):
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
proc.communicate(stdin)
+ elif format == 'eps':
+ command[1] = '-C -z -T -B -d'
+ command[3] = '-E'
+ proc = subprocess.Popen(' '.join(command), shell=True,
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ proc.communicate(stdin)
else:
raise Exception("Invalid file format requested")
return True