Greetings everyone,
this is my code and I am having difficulity creating a "Multipage" PDF to
save to a directory.
any assistance will be welcomed.
Regards,
def taggen_print():
rows = db(db.bike_no.id > 0).select()
for row in rows:
tag_no = row.bike_typ+str(row.id)
pfile = tag_no+'_p.pdf'
pdf = FPDF()
pdf.add_page()
pdf.set_font('Arial', 'B', 14)
pdf.cell(40,10,tag_no)
pdf.output(name=request.folder + '/static/temp.pdf')
response.headers['Content-Disposition']='attachment.filename =' + pfile
response.headers['Content-Type']='application/pdf'
return response.stream(open(request.folder+'/static/temp.pdf',
'rb'),chunk_size=4096)
# pdf.output(pfile, 'F')
redirect(URL("index"))
right now it only saves the PDF for the last record... I need it to create
a page for each record and save it in PDF format in the directory
--