On Wednesday, March 2, 2016 at 6:27:33 PM UTC-8, Dave S wrote:
>
> On Wednesday, March 2, 2016 at 5:35:13 PM UTC-8, Anthony Smith wrote:
>>
>> Hi
>>
>> I am not trying to do anything only following the tutorial, that is the
>> way I have been learning web2py.
>>
>> What other PDF generators does the group recommend? I do like to follow
>> tutorials as I find doing thing that way I find it easy to learn by
>> mistakes and correct problem I create.
>>
>> cheers
>>
>>
> The fpdf stuff is shipped in the box with web2py (under gluon/contribs ).
>
> The tutorial is at
> <URL:https://github.com/reingart/pyfpdf/blob/master/docs/Tutorial.md>
>
> (Note: the book has a simple typo where crediting Mariano, and still
> lists the old URL)
>
> <URL:http://web2py.com/books/default/chapter/29/04/the-core?search=pdf>
>
> I haven't used it, but it gets mentioned frequently in the group.
>
>
In Yet Another Web2Py Task I Have Now Done (YAWTIHND), I've gotten through
the first bit of the tutorial. Some comments:
- the tutorial assumes a Python shell, but only minor tweaks are needed
for doing a controller.
- the import line should be
from gluon.contrib.fpdf import FPDF
- one tweak for doing a controller is to change the output line to
return pdf.output('tuto1.pdf','S')
- I looked at the examples directory, and at <URL:
https://github.com/jredrejo/Labels-for-pyfpdf> (thanks, José L, for your
post a year ago:
<URL:https://groups.google.com/d/msg/web2py/AqyS5IuPuLs/jmtzKf1gnWQJ>.)
- I figured out the 'S' by looking at the code; 'F' is local file, 'S'
is string, 'I' and 'D' use print() (for console use, I guess)
I hope this helps.
/dps
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.