Don't have this statement
return response.stream(open('tuto1.pdf'))
Instead redirect to wherever you want to go next, or just have a plain old
return and use your routine as a function.
Peter
On Monday, 19 November 2012 12:06:51 UTC, Paul Rykiel wrote:
>
> yes, I realize this ... I just don't want a screen to come up.
> The screen PDF displays with the first record. Can we supress?
>
> On Mon, Nov 19, 2012 at 5:16 AM, peter <[email protected]<javascript:>
> > wrote:
>
>> Paul I think you will find that you have created a file. The file
>> tuto1.pdf will be in your web2py folder which is maybe why you are not
>> seeing it.
>>
>> if you do
>>
>> pdf.output(name=request.folder+'/static/tuto1.pdf')
>>
>> It would put it in the static folder of your application.
>>
>> Peter
>>
>>
>> On Monday, 19 November 2012 02:30:14 UTC, Paul Rykiel wrote:
>>>
>>> Thank you Peter... i actually got it working, but I have a specific
>>> question ... I have been just trying out the PDF creation and the following
>>> example works great ... it is simple and I think it will suffice, here is
>>> my question ... how do I get it to save to a director and not just display
>>> the PDF on the screen? any help you can offer would be great. Regards,
>>>
>>> from gluon.contrib.fpdf import FPDF
>>> def pdfexp():
>>> example = "this is an example"
>>> example2 = "this is example 2"
>>> pdf=FPDF()
>>> pdf.add_page()
>>> pdf.set_font('Arial','B',16)
>>> pdf.cell(40,10, example)
>>> pdf.add_page()
>>> pdf.set_font('Arial','B',16)
>>> pdf.cell(40,10, example2)
>>> pdf.output('tuto1.pdf','F')
>>> return response.stream(open('tuto1.**pdf'))
>>>
>>> On Sunday, November 18, 2012 3:39:44 AM UTC-6, peter wrote:
>>>
>>>> Paul here is a reply to your pyfpdf question.
>>>>
>>>> I think the best way to use pyfpdf with web2py is not to install
>>>> pyfpdf, but to include it in your application. So download the source
>>>> file.
>>>> Put all the .py files in the modules folder of your application. Copy the
>>>> font folder into the modules folder of your app. Remember to restart
>>>> web2py
>>>> to allow the changes in the module folder to filter through. This works
>>>> for
>>>> me and I find pyfpdf pretty good.
>>>>
>>>> Peter
>>>>
>>>> On Tuesday, 13 November 2012 23:28:59 UTC, Paul Rykiel wrote:
>>>>>
>>>>> Hi just learning WEB2py and I have a question:
>>>>>
>>>>> why do i get an error on this code
>>>>> **** This code errors out, but when I replace "tag_no" with 1 for
>>>>> record id 1, it works, also the variable "tag_no" has a 1 as a value when
>>>>> i
>>>>> type in an argument 1 on the end of the URL *
>>>>>
>>>>> def tag():
>>>>> tag_no = request.args(0)
>>>>> Title = "For Sale"
>>>>> * Rows = db(db.bike.id==tag_no).select() *
>>>>> for row in Rows:
>>>>> serial = row.serial
>>>>> make = row.make
>>>>> model = row.model
>>>>> size = row.size
>>>>> color = row.color
>>>>> style = row.style
>>>>> date_of_receipt = row.date_of_receipt
>>>>> repairs = row.repairs_done
>>>>> price = row.price
>>>>> return locals()
>>>>>
>>>> --
>>
>>
>>
>>
>
>
--