pdf = PDFSurface('out.pdf', 1000, 1000)
cr = Context(pdf)
im = Image.open('/home/seif/Pictures/prw.jpg')
buffer = StringIO.StringIO()
im.save(buffer, format='PNG')
buffer.seek(0)
cr.save()
cr.set_source_surface(ImageSurface.create_from_png(buffer))
cr.paint()
paint decoded jpeg to cairo surface