| 107 | def convertToTiffMultiPage24NC(self, fname, dpi) : |
| 108 | """Converts the input file to TIFF format, X dpi, 24 bits per pixel, uncompressed. |
| 109 | Writes TIFF datas to the outputfile file object. |
| 110 | """ |
| 111 | command = 'gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r%i -sOutputFile="%s" -' % (dpi, fname) |
| 112 | child = popen2.Popen4(command) |
| 113 | try : |
| 114 | data = self.infile.read(pdlparser.MEGABYTE) |
| 115 | while data : |
| 116 | child.tochild.write(data) |
| 117 | data = self.infile.read(pdlparser.MEGABYTE) |
| 118 | child.tochild.flush() |
| 119 | child.tochild.close() |
| 120 | except (IOError, OSError), msg : |
| 121 | raise pdlparser.PDLParserError, "Problem during conversion to TIFF : %s" % msg |
| 122 | |
| 123 | child.fromchild.close() |
| 124 | try : |
| 125 | child.wait() |
| 126 | except OSError, msg : |
| 127 | raise pdlparser.PDLParserError, "Problem during conversion to TIFF : %s" % msg |
| 128 | |