packet = StringIO.StringIO() can = canvas.Canvas(packet, pagesize=letter) <do something with canvas> can.save() packet.seek(0) input = PdfFileReader(packet)