def testRun(name,surname,tc,printnum,x0,y0,z0,r0): name = name.replace('"','') x1 = ast.literal_eval(x0) y1 = ast.literal_eval(y0) z1 = ast.literal_eval(z0) r1 = ast.literal_eval(r0) lImagePath = lastImage.find() #lImagePath = "getPicture.jpg" if (os.path.isfile(lImagePath)): print "loading... " + lImagePath i_base = Image.open(lImagePath) i_base = rotate.rotateImage(resizeZ(i_base, z1),270 - int(r1)) i_base = cropImage(i_base, transform(i_base ,imgSize, x1, y1 -200) ) i_base = cropImage(resizeImage(i_base), icaoSize) i_out = multiplexImage( Image.new("RGB", finalPaperSize , "white") , i_base) out = drawInfo.draw(i_out, name, surname, tc, misc.timeString()) print "saving... to out\\" #i_out.save("out\\" + os.path.basename(lImagePath)) i_out.save("out\\" + tc + ".jpg") print "printing..." for x in range(0,int(printnum)): print "Printed %d" % (x) jpgprinter.printImage(printerNm,i_out, "DS360 - OUT") return "Print Request Done" else: return "File find error... aborted"
def print_image_x(img ,times): if(misc.is_no_print_mode): return misc.log_("Printer", "enter" ) for x in range(0, times): misc.log_("Printer", "Print Request %d" % (x + 1) ) jpgprinter.printImage( printer_name, img, ("DS360 - OUT %d" % (x + 1)) ) misc.log_("Printer", "exit" )