Wednesday, November 26, 2014

Re: redirect or reload page after pdf file generation.

Hi Bo,

One thing I've done is had the form redirect to a page saying "generating pdf", and then that page has a <meta http-equiv="refresh" content="5; url=/actual/pdf/?info_from_form">

Collin


On Tuesday, November 25, 2014 3:28:31 AM UTC-5, bo liu wrote:
Hi, jai,
     Do you resolve this it? I have the same issue right now. Could you share your solution? thanks a lot.

Bo

On Wednesday, November 4, 2009 8:43:12 AM UTC-8, jai_python wrote:
I save the response content in pdf file and then page will be
redirected and pdf file will be called on page onload

Thanks
Jai

On Nov 3, 11:10 am, Jani Tiainen <rede...@gmail.com> wrote:
> jai_python kirjoitti:
>
>
>
> > Hello every one,
>
> > I have a form which contains group of data and I can select some of
> > them to take pdf file.  When I submit the form, it returns pdf file
> > which contains the selected data. But i need to redirect or reload the
> > present form after pdf file has been generated inorder to remove
> > previous entry(i.e data included in the pdf file ) . Here goes my
> > source
>
> > def getPDF(request):
> >       if not request.POST:
> >                return to html form page
> >       response = HttpResponse(mimetype='application/pdf')
> >       #some content will be added to response with the use REPORTLAB
> >       return response# will return pdf
>
> > This response will sent an pdf file to client side. same time i want
> > to reload or refresh after pdf file generation.
>
> I don't think that such a mechanism exists in HTTP protocol so what
> you're asking might not be really possible.
>
> With little JS (ajax iframe download) you can achieve that kind of
> refresh like functionality. But it relies on ajax functionality.
>
> --
> Jani Tiainen

--
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+unsubscribe@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.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/877ca904-fee9-441f-b3ed-68367d89894b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment