它使用python的pollyreport库。
from PollyReports import *
from reportlab.pdfgen.canvas import Canvas
output = []
with open('textfile.txt','r') as f:
for line in f:
if 'india' in line:
output.append(line)
print output
rpt = Report(datasource = output, detailband = Band
([
Element((10,10), ("Helvetica", 12), text=output[0]),
]))
canvas = Canvas("lprep01.pdf")
rpt.generate(canvas)
canvas.save()