summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorSlagvi Public <JandotDarowskiattgmaildottcom>2013-09-20 14:21:32 +0000
committerSlagvi Public <JandotDarowskiattgmaildottcom>2013-09-20 14:21:32 +0000
commit09a3c627485c2ad6ca67e943b79d453d69ba862a (patch)
treeea66d52d887e85a942e32ada0ce991a4fedb1944 /share
parentSmall style fixes. (diff)
downloadinkscape-09a3c627485c2ad6ca67e943b79d453d69ba862a.tar.gz
inkscape-09a3c627485c2ad6ca67e943b79d453d69ba862a.zip
Fix Empty Page procedural template.
(bzr r12481.1.11)
Diffstat (limited to 'share')
-rw-r--r--share/extensions/empty_page.inx10
-rw-r--r--share/extensions/empty_page.py25
2 files changed, 18 insertions, 17 deletions
diff --git a/share/extensions/empty_page.inx b/share/extensions/empty_page.inx
index 594938ea1..2eceb84bd 100644
--- a/share/extensions/empty_page.inx
+++ b/share/extensions/empty_page.inx
@@ -5,16 +5,16 @@
<dependency type="executable" location="extensions">empty_page.py</dependency>
<dependency type="executable" location="extensions">inkex.py</dependency>
- <_param name="size-help" type="description">Select your empty page size.</_param>
<param name="size" _gui-text="Page size:" type="enum">
<item value="a3">A3</item>
<item value="a4">A4</item>
<item value="a5">A5</item>
- <item value="a3l">A3 landscape</item>
- <item value="a4l">A4 landscape</item>
- <item value="a5l">A5 landscape</item>
<item value="letter">letter</item>
- <item value="letterl">letter landscape</item>
+ </param>
+
+ <param name="orientation" _gui-text="Page orientation:" type="enum">
+ <item value="horizontal">Horizontal</item>
+ <item value="vertical">Vertical</item>
</param>
<effect needs-live-preview="false">
diff --git a/share/extensions/empty_page.py b/share/extensions/empty_page.py
index df5d132eb..dc16bab97 100644
--- a/share/extensions/empty_page.py
+++ b/share/extensions/empty_page.py
@@ -6,38 +6,39 @@ class C(inkex.Effect):
def __init__(self):
inkex.Effect.__init__(self)
self.OptionParser.add_option("-s", "--size", action="store", type="string", dest="page_size", default="a4", help="Page size")
+ self.OptionParser.add_option("-o", "--orientation", action="store", type="string", dest="page_orientation", default="vertical", help="Page orientation")
def effect(self):
root = self.document.getroot()
root.set("width", "12in")
root.set("height", "12in")
- if self.options.page_size == "a4":
+ if self.options.page_size == "a4" and self.options.page_orientation == "vertical":
root.set("width", "210mm")
root.set("height", "297mm")
- if self.options.page_size == "a4l":
+ if self.options.page_size == "a4" and self.options.page_orientation == "horizontal":
root.set("height", "210mm")
root.set("width", "297mm")
- if self.options.page_size == "a5":
+ if self.options.page_size == "a5" and self.options.page_orientation == "vertical":
root.set("width", "148mm")
root.set("height", "210mm")
- if self.options.page_size == "a5l":
+ if self.options.page_size == "a5" and self.options.page_orientation == "horizontal":
root.set("width", "210mm")
root.set("height", "148mm")
- if self.options.page_size == "a3":
+ if self.options.page_size == "a3" and self.options.page_orientation == "vertical":
root.set("width", "297mm")
root.set("height", "420mm")
- if self.options.page_size == "a3l":
+ if self.options.page_size == "a3" and self.options.page_orientation == "horizontal":
root.set("width", "420mm")
root.set("height", "297mm")
- if self.options.page_size == "letter":
- root.set("width", "216mm")
- root.set("height", "279mm")
- if self.options.page_size == "letterl":
- root.set("width", "279mm")
- root.set("height", "216mm")
+ if self.options.page_size == "letter" and self.options.page_orientation == "vertical":
+ root.set("width", "8.5in")
+ root.set("height", "11in")
+ if self.options.page_size == "letter" and self.options.page_orientation == "horizontal":
+ root.set("width", "11in")
+ root.set("height", "8.5in")
c = C()
c.affect()