179 | | def convertToTiffMultiPage24NC(self, fname, dpi) : |
180 | | """Converts the input file to TIFF format, X dpi, 24 bits per pixel, uncompressed. |
181 | | Writes TIFF datas to the outputfile file object. |
182 | | """ |
183 | | command = 'gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r%i -sOutputFile="%s" -' % (dpi, fname) |
184 | | child = popen2.Popen4(command) |
185 | | try : |
186 | | data = self.infile.read(pdlparser.MEGABYTE) |
187 | | while data : |
188 | | child.tochild.write(data) |
189 | | data = self.infile.read(pdlparser.MEGABYTE) |
190 | | child.tochild.flush() |
191 | | child.tochild.close() |
192 | | except (IOError, OSError), msg : |
193 | | raise pdlparser.PDLParserError, "Problem during conversion to TIFF : %s" % msg |
194 | | |
195 | | child.fromchild.close() |
196 | | try : |
197 | | child.wait() |
198 | | except OSError, msg : |
199 | | raise pdlparser.PDLParserError, "Problem during conversion to TIFF : %s" % msg |
200 | | |