Try this:
def taggen_print():
* pdf = FPDF()*
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.add_page()
pdf.set_font('Arial', 'B', 14)
pdf.cell(40,10,tag_no)
* pdf.AddPage()*
* 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"))
On Wed, Nov 21, 2012 at 5:18 AM, LightDot <[email protected]> wrote:
> This group is a wealth of information for other users, so when you can,
> please do post what is it that you've figured out. :)
>
> It's highly likely someone will have the same or similar problem and
> search for answers.
>
> Regards,
> Ales
>
>
> On Wednesday, November 21, 2012 6:36:04 AM UTC+1, Paul Rykiel wrote:
>>
>> Nevermind ... figured it out
>> On Tuesday, November 20, 2012 3:06:22 PM UTC-6, Paul Rykiel wrote:
>>>
>>> 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
>>>
>> --
>
>
>
>
--