Changeset 4562
- Timestamp:
- 10/24/08 06:18:46 (3 months ago)
- Files:
-
- pagetodocintegration/0.11/pagetodoc/pagetodoc.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pagetodocintegration/0.11/pagetodoc/pagetodoc.py
r4197 r4562 28 28 img_max_x = '0' 29 29 img_max_y = '0' 30 dpi = '96' 31 cm2inch = 2.54 30 32 31 33 verbose = False … … 41 43 self.img_max_x = self.env.config.get('pagetodoc', 'img_max_x', self.img_max_x) 42 44 self.img_max_y = self.env.config.get('pagetodoc', 'img_max_y', self.img_max_y) 45 self.img_max_y = self.env.config.get('pagetodoc', 'dpi', self.dpi) 43 46 44 47 # XSL-Transformation … … 96 99 self.perform_workarounds(htmlfilepath, 'html') 97 100 98 cmd = 'xsltproc %s -o %s %s %s' % (('-v' if self.verbose else ''), wordfilepath, xsltfilepath, htmlfilepath) 101 if self.verbose: 102 verb = '-v' 103 else: 104 verb = '' 105 cmd = 'xsltproc %s -o %s %s %s' % (verb, wordfilepath, xsltfilepath, htmlfilepath) 99 106 self.execute_external_program(cmd) 100 107 … … 200 207 201 208 # resize images, if wanted, using ImageMagick 202 if int(self.img_max_x) > 0 and int(self.img_max_y) > 0: 203 args = "-resize '%sx%s>'" % (self.img_max_x, self.img_max_y) 209 if int(self.img_max_x)/self.cm2inch*int(self.dpi) > 0 and int(self.img_max_y)/self.cm2inch*int(self.dpi) > 0: 210 #args = "-density %sd -resize '%sx%s>'" % (self.dpi, self.img_max_x, self.img_max_y) 211 args = "-resize '%sx%s>' -resample %s" % (self.img_max_x, self.img_max_y, self.dpi) 212 204 213 cmd = 'convert %s %s %s' % (fn, args, fn) 205 214 self.execute_external_program(cmd)
