Permalink
Browse files

check page orientation, set landscape to false by default

  • Loading branch information...
1 parent 67a3b6b commit 3c9f18fd99475c22612ab8b35636441f28f231cc @kgrodzicki kgrodzicki committed Jul 28, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 xhtml2pdf/context.py
View
@@ -209,12 +209,12 @@ def atPage(self, name, pseudopage, declarations):
if data.has_key("-pdf-page-size"):
c.pageSize = xhtml2pdf.default.PML_PAGESIZES.get(str(data["-pdf-page-size"]).lower(), c.pageSize)
+ isLandscape = False
if data.has_key("size"):
size = data["size"]
# print size, c.pageSize
if type(size) is not types.ListType:
size = [size]
- isLandscape = False
sizeList = []
for value in size:
valueStr = str(value).lower()
@@ -296,6 +296,9 @@ def atPage(self, name, pseudopage, declarations):
pt.pisaBackground = background
pt.pisaBackgroundList = c.pisaBackgroundList
+ if isLandscape:
+ pt.pageorientation = pt.LANDSCAPE
+
# self._pagesize)
# pt.pml_statics = self._statics
# pt.pml_draw = self._draw

0 comments on commit 3c9f18f

Please sign in to comment.