One alternative could be to
1) install princexml in your server (http://www.princexml.com), check the
licence for commercial use
2) in controller:
def print_pdf():
response.headers['Content-Type']='application/pdf'
from subprocess import Popen, PIPE
# on windows (full path of binary)
prince = "C:/Program Files (x86)/Prince/engine/bin/prince.exe"
# on linux, mac
prince = "prince"
p = Popen([prince,"-"], stdin=PIPE, stdout=PIPE)
# create an html page and add the relevant css for the pdf
style = STYLE()
style.append("@page {size: A4 ; margin: 120pt 0pt 60pt 50pt }")
style.append("@page {@top-right {content: 'TEST PAGE PDF';
margin-right: 30px;}}")
body = BODY()
body.append(XML('<h1> pdf </h1>'))
body.append(XML('hello <b>World</b> <br/> <br/>'))
body.append(TABLE(TR(TD('This is '), TD('a table')), _border="1"))
the_page_to_print_in_html = HTML(HEAD(style), BODY(body)).xml()
# see online documentation for other options to generate the pdf
p.stdin.write( the_page_to_print_in_html )
p.stdin.close()
pdf = p.stdout.read()
return pdf
On Sat, Mar 12, 2016 at 4:28 PM, prashant joshi <[email protected]>
wrote:
> thank u
>
> On Sat, Mar 12, 2016 at 11:52 AM, xmarx <[email protected]> wrote:
>
>> pyfpdf is installed on web2py.
>>
>> docs and tutorials can be found here:
>> http://pyfpdf.readthedocs.org/en/latest/Web2Py/index.html
>>
>> 11 Mart 2016 Cuma 21:36:41 UTC+2 tarihinde prashant joshi yazdı:
>>
>>> i want crete sql form if i click on print button then form printout in
>>> pdf format
>>> how it wiil done in web2py??
>>> how use ReportLab library??
>>>
>> --
>> 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.
>>
>
> --
> 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.
>
--
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.