summaryrefslogtreecommitdiff
path: root/MAT/office.py
diff options
context:
space:
mode:
Diffstat (limited to 'MAT/office.py')
-rw-r--r--MAT/office.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/MAT/office.py b/MAT/office.py
index 339f3e3..50a4282 100644
--- a/MAT/office.py
+++ b/MAT/office.py
@@ -14,6 +14,7 @@ try:
14 import cairo 14 import cairo
15 from gi.repository import Poppler 15 from gi.repository import Poppler
16except ImportError: 16except ImportError:
17 logging.info('office.py loaded without PDF support')
17 pass 18 pass
18 19
19import mat 20import mat
@@ -44,7 +45,7 @@ class OpenDocumentStripper(archive.GenericArchiveStripper):
44 metadata[nodename] = ''.join([j.data for j in i.childNodes]) 45 metadata[nodename] = ''.join([j.data for j in i.childNodes])
45 else: 46 else:
46 # thank you w3c for not providing a nice 47 # thank you w3c for not providing a nice
47 # method to get all attributes from a node 48 # method to get all attributes of a node
48 pass 49 pass
49 zipin.close() 50 zipin.close()
50 except KeyError: # no meta.xml file found 51 except KeyError: # no meta.xml file found
@@ -162,7 +163,7 @@ class PdfStripper(parser.GenericParser):
162 surface = cairo.PDFSurface(output, page_width, page_height) 163 surface = cairo.PDFSurface(output, page_width, page_height)
163 context = cairo.Context(surface) # context draws on the surface 164 context = cairo.Context(surface) # context draws on the surface
164 logging.debug('PDF rendering of %s' % self.filename) 165 logging.debug('PDF rendering of %s' % self.filename)
165 for pagenum in xrange(self.document.get_n_pages()): 166 for pagenum in range(self.document.get_n_pages()):
166 page = self.document.get_page(pagenum) 167 page = self.document.get_page(pagenum)
167 context.translate(0, 0) 168 context.translate(0, 0)
168 if self.pdf_quality: 169 if self.pdf_quality: