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.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/fedora_business_cards/export.py b/fedora_business_cards/export.py
index 597c61a..c6d8a86 100644
--- a/fedora_business_cards/export.py
+++ b/fedora_business_cards/export.py
@@ -24,6 +24,15 @@ Functions to export cards from SVGs.
import subprocess
+def svg_to_file(xmlstring, filename):
+ """
+ Write an SVG to a file.
+ """
+ f = file(filename, 'w')
+ f.write(xmlstring.encode('utf-8'))
+ f.close()
+ return True
+
def svg_to_pdf_png(xmlstring, filename, format='png', dpi=300):
"""
Export an SVG to either a PDF or PNG.
@@ -45,3 +54,4 @@ def svg_to_pdf_png(xmlstring, filename, format='png', dpi=300):
sp.communicate(stdin)
else:
raise Exception("Invalid file format requested")
+ return True