Re: django generate pdf with tables and charts

2013-02-15 Thread Christian Schmitt
Maybe this Issue could help you 
http://code.google.com/p/wkhtmltopdf/issues/detail?id=948
Also pass --enable javascript and the javascript delay to wkhtmltopdf

Am Donnerstag, 14. Februar 2013 15:45:38 UTC+1 schrieb Jaimin Patel:
>
> Sure.
>
> I had tried to render PDF with pisa,
>
> template = get_template(template_src)
> context = Context(context_dict)
> html  = template.render(context)
> result = StringIO.StringIO()
>
> pdf = pisa.pisaDocument(StringIO.StringIO(html.encode("ISO-8859-1")), 
> result, link_callback=fetch_resources)
> if not pdf.err:
> return HttpResponse(result.getvalue(), mimetype='application/pdf')
> return HttpResponse('Errors%s' % escape(html))
>
> Also tried with wkhtmltopdf -
>
> from wkhtmltopdf.views import PDFTemplateResponse
> ..
> return PDFTemplateResponse(request, 'pdf/pdftemplate.html', {
> 'pagesize':'A4',
>'user': results['user'],
>'question': results['question_obj'],
>})
>
> In both cases it doesn't render the elements which I am populating with 
> help of onload javascript function.
>
> On Wednesday, February 13, 2013 10:45:40 PM UTC-5, ovnicraft wrote:
>>
>>
>>
>>
>> On Sun, Feb 10, 2013 at 11:10 AM, Jaimin Patel wrote:
>>
>>> I am trying to generate pdf using django template, also need some 
>>> support of javascript code. I have tried PISA, ReportLib and wkhtmltopdf 
>>> but it seems that it doesn't wait for Javascript. 
>>
>>
>> Hello, can you explain us better what you means with *does not wait for 
>> JS* ? 
>> I understand you say: pdf is rendered w/o running JS code.
>>
>> Regards, 
>>
>>>
>>> Can someone suggest good solution or example?
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>  
>>>  
>>>
>>
>>
>>
>> -- 
>> Cristian Salamea
>> @ovnicraft 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django generate pdf with tables and charts

2013-02-14 Thread Jaimin Patel
Sorry I posted the answer on wrong thread, 

Sure.

I had tried to render PDF with pisa,

template = get_template(template_src)
context = Context(context_dict)
html  = template.render(context)
result = StringIO.StringIO()

pdf = pisa.pisaDocument(StringIO.StringIO(html.encode("ISO-8859-1")), 
result, link_callback=fetch_resources)
if not pdf.err:
return HttpResponse(result.getvalue(), mimetype='application/pdf')
return HttpResponse('Errors%s' % escape(html))

Also tried with wkhtmltopdf -

from wkhtmltopdf.views import PDFTemplateResponse
..
return PDFTemplateResponse(request, 'pdf/pdftemplate.html', {
'pagesize':'A4',
   'user': results['user'],
   'question': results['question_obj'],
   })

In both cases it doesn't render the elements which I am populating with 
help of onload javascript function.

On Wednesday, February 13, 2013 10:45:40 PM UTC-5, ovnicraft wrote:
>
>
>
>
> On Sun, Feb 10, 2013 at 11:10 AM, Jaimin Patel 
>  > wrote:
>
>> I am trying to generate pdf using django template, also need some support 
>> of javascript code. I have tried PISA, ReportLib and wkhtmltopdf but it 
>> seems that it doesn't wait for Javascript. 
>
>
> Hello, can you explain us better what you means with *does not wait for 
> JS* ? 
> I understand you say: pdf is rendered w/o running JS code.
>
> Regards, 
>
>>
>> Can someone suggest good solution or example?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>
>
> -- 
> Cristian Salamea
> @ovnicraft 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django generate pdf with tables and charts

2013-02-14 Thread Jaimin Patel
Sure.

I had tried to render PDF with pisa,

template = get_template(template_src)
context = Context(context_dict)
html  = template.render(context)
result = StringIO.StringIO()

pdf = pisa.pisaDocument(StringIO.StringIO(html.encode("ISO-8859-1")), 
result, link_callback=fetch_resources)
if not pdf.err:
return HttpResponse(result.getvalue(), mimetype='application/pdf')
return HttpResponse('Errors%s' % escape(html))

Also tried with wkhtmltopdf -

from wkhtmltopdf.views import PDFTemplateResponse
..
return PDFTemplateResponse(request, 'pdf/pdftemplate.html', {
'pagesize':'A4',
   'user': results['user'],
   'question': results['question_obj'],
   })

In both cases it doesn't render the elements which I am populating with 
help of onload javascript function.

On Wednesday, February 13, 2013 10:45:40 PM UTC-5, ovnicraft wrote:
>
>
>
>
> On Sun, Feb 10, 2013 at 11:10 AM, Jaimin Patel 
>  > wrote:
>
>> I am trying to generate pdf using django template, also need some support 
>> of javascript code. I have tried PISA, ReportLib and wkhtmltopdf but it 
>> seems that it doesn't wait for Javascript. 
>
>
> Hello, can you explain us better what you means with *does not wait for 
> JS* ? 
> I understand you say: pdf is rendered w/o running JS code.
>
> Regards, 
>
>>
>> Can someone suggest good solution or example?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>
>
> -- 
> Cristian Salamea
> @ovnicraft 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django generate pdf with tables and charts

2013-02-14 Thread Frank Bieniek

Checkout happypdf.com
rest call to create your pdfs

Am 14.02.2013 04:28, schrieb Waitman Gobble:



On Feb 10, 2013 8:11 AM, "Jaimin Patel" > wrote:

>
> I am trying to generate pdf using django template, also need some 
support of javascript code. I have tried PISA, ReportLib and 
wkhtmltopdf but it seems that it doesn't wait for Javascript.

>
> Can someone suggest good solution or example?
>
> --
> You received this message because you are subscribed to the Google 
Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, 
send an email to django-users+unsubscr...@googlegroups.com 
.
> To post to this group, send email to django-users@googlegroups.com 
.

> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

You could send a request using Ajax, to a cgi program on the server, 
and include the URL. The program would pull the content and convert to 
pdf, then return the URL of the document. If the user has to be 
authenticated to view the content, then you would have to pass the 
authentication key to the CGI program. You may find something like 
html2pdf will do the conversion, there are free and non-free programs 
available.


Waitman Gobble
San Jose California USA

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com.

To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django generate pdf with tables and charts

2013-02-13 Thread Ovnicraft
On Sun, Feb 10, 2013 at 11:10 AM, Jaimin Patel  wrote:

> I am trying to generate pdf using django template, also need some support
> of javascript code. I have tried PISA, ReportLib and wkhtmltopdf but it
> seems that it doesn't wait for Javascript.


Hello, can you explain us better what you means with *does not wait for JS*
?
I understand you say: pdf is rendered w/o running JS code.

Regards,

>
> Can someone suggest good solution or example?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Cristian Salamea
@ovnicraft

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django generate pdf with tables and charts

2013-02-13 Thread Waitman Gobble
On Feb 10, 2013 8:11 AM, "Jaimin Patel"  wrote:
>
> I am trying to generate pdf using django template, also need some support
of javascript code. I have tried PISA, ReportLib and wkhtmltopdf but it
seems that it doesn't wait for Javascript.
>
> Can someone suggest good solution or example?
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

You could send a request using Ajax, to a cgi program on the server, and
include the URL. The program would pull the content and convert to pdf,
then return the URL of the document. If the user has to be authenticated to
view the content, then you would have to pass the authentication key to the
CGI program. You may find something like html2pdf will do the conversion,
there are free and non-free programs available.

Waitman Gobble
San Jose California USA

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django generate pdf with tables and charts

2013-02-13 Thread Peter of the Norse
Django doesn’t run Javascript, that’s done in the browser. If you really want 
to have JS processing you’ll have to open a web browser and then print to PDF.

On Feb 10, 2013, at 9:10 AM, Jaimin Patel wrote:

> I am trying to generate pdf using django template, also need some support of 
> javascript code. I have tried PISA, ReportLib and wkhtmltopdf but it seems 
> that it doesn't wait for Javascript. 
> 
> Can someone suggest good solution or example?
> 

Peter of the Norse
rahmc...@radio1190.org



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




django generate pdf with tables and charts

2013-02-10 Thread Jaimin Patel
I am trying to generate pdf using django template, also need some support 
of javascript code. I have tried PISA, ReportLib and wkhtmltopdf but it 
seems that it doesn't wait for Javascript. 

Can someone suggest good solution or example?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.