Welcome Guest, Not a member yet? Register   Sign In
msg while generate large pdf file
#1

[eluser]kmil0[/eluser]
Hi guys, this maybe is not a CI question sorry for this and for the english toTongue

I have a link that when pressed will begin to generate a pdf file that can take a long time,
What I want is to display a message while the server complete the process and the file is ready for download.

The link points to something like

Code:
http://host.com/controller/pdf/1

That's when it begins to generate

I have searched in google for if there was something with jquery but did not find anything relevant
any ideas?

thanks guys Smile
#2

[eluser]Damien K.[/eluser]
Short answer: AJAX

Spend 2 more minutes searching and you will find that jQuery can do it.
#3

[eluser]kmil0[/eluser]
I spend more than 2 days and nothing...
i try with iframes, loading with ajax.

with something like this

Code:
$('#myframe').load('url_to_pdf');

but this load the RAW data of the PDF file :S
but thanks, I'm still searching...
#4

[eluser]pistolPete[/eluser]
Is it possible for you to save the generated PDF on the server?
#5

[eluser]Unknown[/eluser]
[quote author="kmil0" date="1253963552"]Hi guys, this maybe is not a CI question sorry for this and for the english toTongue

I have a link that when pressed will begin to generate a pdf file that can take a long time,
What I want is to display a message while the server complete the process and the file is ready for download.

The link points to something like

Code:
http://host.com/controller/pdf/1

That's when it begins to generate

I have searched in google for if there was something with jquery but did not find anything relevant
any ideas?

thanks guys Smile[/quote]
#6

[eluser]Damien K.[/eluser]
This is the pseudo-code, mind you.

- Click on link
- Dynamically show waiting icon, possibly with text "Generating document..."
- When completed, the PDF document will load as usual

No real AJAX here (i.e., asynchronous calls).
#7

[eluser]InsiteFX[/eluser]
There is an article on nettuts that show how to do all of this!

search for jeffery way

Enjoy
InsiteFX
#8

[eluser]kmil0[/eluser]
thanks for the replays..
first, not, is not possible to save the document on the server Sad, thanks pistolPete

yeah, Damien K. thats the 'pseudo-code', I'm using Dompdf to generate the file,
is easy to make a spinner that show a message with "loading file.." when somebody click on the "to pdf" link,
but.. how do i know when the file is ready ?? ("when pop-up the window to download the file"),
with this I can hide the message


InsiteFX, thanks, I will spend some time looking for 'jeffery way'

Smile
#9

[eluser]Damien K.[/eluser]
A relevant question would be: do you want it in the same window or a new window? Implementation would differ depending on how you want it delivered.
#10

[eluser]kmil0[/eluser]
hi Damien K.
is in the same window.
look, i have make a 'test page', try it yourself.

when you click in generate pdf , the result take a long time..., and a normal user thinks that the link does not work! :S

http//nerp.senscore.net/test.php

thanks!




Theme © iAndrew 2016 - Forum software by © MyBB