Progress bar for PDF file and load it.

This is a discussion on Progress bar for PDF file and load it. within the PHP General forums, part of the PHP Programming Forums category; Hi all, I am creating a pdf file with FPDF. The data are queried from a database. For a large ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2004
Harry Yau
 
Posts: n/a
Default Progress bar for PDF file and load it.

Hi all,

I am creating a pdf file with FPDF. The data are queried from a
database. For a large pdf file, It might take upto 10 mins to finish.
I want to have a progress bar to show the progress status. I tried to
echo some word to the browser every little while. However, as the
header of the result page is set to "content-type:application/pdf". I
can't echo words at all.

On the other hand, if I echo some word during the process and
redirect the page to the pdf file, I keep getting the "Header Has
Already Sent" error as the redirect mainly setting the header with
location to somewhere after the output is sent.

Finally, I think of a stupid method. I set the Header to
"content-type:application/pdf" before the processing the result set
from the database. Then after about each 100 records are processed, I
will read a pre-created pdf file with a number on it and then flush()
it to the browser.

Actually, I use this method to keep the browser alive during the
long process of creating the pdf file.

Although the browser (including IE 6.0, Netscape 7.0,
MozillaFirdBird...etc.) is kept alive, the pre-created pdf file is
never shown. Therefore, the progress status is never shown!

Please let me know is there any method to show the progress status
before reading a PDF file to the browser.

Thank You Very Much!~

Harry Yau
Reply With Quote
  #2 (permalink)  
Old 02-19-2004
Harry Yau
 
Posts: n/a
Default Re: Progress bar for PDF file and load it.

harry@grandford.com (Harry Yau) wrote in message news:<23b0453a.0402172147.9d11522@posting.google.c om>...
> Hi all,
>
> I am creating a pdf file with FPDF. The data are queried from a
> database. For a large pdf file, It might take upto 10 mins to finish.
> I want to have a progress bar to show the progress status. I tried to
> echo some word to the browser every little while. However, as the
> header of the result page is set to "content-type:application/pdf". I
> can't echo words at all.
>
> On the other hand, if I echo some word during the process and
> redirect the page to the pdf file, I keep getting the "Header Has
> Already Sent" error as the redirect mainly setting the header with
> location to somewhere after the output is sent.
>
> Finally, I think of a stupid method. I set the Header to
> "content-type:application/pdf" before the processing the result set
> from the database. Then after about each 100 records are processed, I
> will read a pre-created pdf file with a number on it and then flush()
> it to the browser.
>
> Actually, I use this method to keep the browser alive during the
> long process of creating the pdf file.
>
> Although the browser (including IE 6.0, Netscape 7.0,
> MozillaFirdBird...etc.) is kept alive, the pre-created pdf file is
> never shown. Therefore, the progress status is never shown!
>
> Please let me know is there any method to show the progress status
> before reading a PDF file to the browser.
>
> Thank You Very Much!~
>
> Harry Yau



Hi all,
I think my real question is how could to make the browser show
whatever it has received from point to point. As I know IE won't show
data until it receive something like "End Of Document Character". How
could I sent one signal to make the browser to really flush the data
to the screen. Moreover, is it possible to send data after the "End Of
Document Character" is sent?
I hope I didn't make the problem even more un-clear!
Thank You Very Much!

Harry Yau
Reply With Quote
  #3 (permalink)  
Old 02-20-2004
George Howell
 
Posts: n/a
Default Re: Progress bar for PDF file and load it.

How about saving the pdf locally, and have your 'proper' php page display
a status bar? Then, when the file completes, send it from the storage
on the server and erase it? Not sure of ANY of the specifics of this,
but it's a method that might work.

On 17 Feb 2004 21:47:22 -0800, Harry Yau <harry@grandford.com> wrote:
> Hi all,
>
> I am creating a pdf file with FPDF. The data are queried from a
> database. For a large pdf file, It might take upto 10 mins to finish.
> I want to have a progress bar to show the progress status. I tried to
> echo some word to the browser every little while. However, as the
> header of the result page is set to "content-type:application/pdf". I
> can't echo words at all.
>
> On the other hand, if I echo some word during the process and
> redirect the page to the pdf file, I keep getting the "Header Has
> Already Sent" error as the redirect mainly setting the header with
> location to somewhere after the output is sent.
>
> Finally, I think of a stupid method. I set the Header to
> "content-type:application/pdf" before the processing the result set
> from the database. Then after about each 100 records are processed, I
> will read a pre-created pdf file with a number on it and then flush()
> it to the browser.
>
> Actually, I use this method to keep the browser alive during the
> long process of creating the pdf file.
>
> Although the browser (including IE 6.0, Netscape 7.0,
> MozillaFirdBird...etc.) is kept alive, the pre-created pdf file is
> never shown. Therefore, the progress status is never shown!
>
> Please let me know is there any method to show the progress status
> before reading a PDF file to the browser.
>
> Thank You Very Much!~
>
> Harry Yau



--
George Howell "I ride for the same reason dogs stick their head out
ghowell@refundersrefuge.org of car windows"
gmhowell@comcast.net
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:14 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0