Solved

Fastest serve of generated PDF file....

Posted on 2007-11-16
1
590 Views
Last Modified: 2008-02-01
Hello all,

I am generating a PDF file using the FPDF library and FPDF2File also to help memory issue and generation speed. I have the 24MB average file down to 20 second to make and serve to users browser.

To increase perceived d'load speed I thought to output header at script begining to give browser time to load plugin while waiting for document though it seems as if it wants to actually start receiving the document to load reader plugin into IE or FF.

What I would like to know if it is possible, practical or wise to try to serve the document as it is being generated to disk, or is it possible to serve a file without knowing the final end size of the document. And, as the preview document is deleted right after serve then can it be done without corrupting document.

All code or knowledge on how to squeeze all speed out of this process possible appreciated.

Thank you for your time.
0
Comment
Question by:tcraigo5114
1 Comment
 
LVL 20

Accepted Solution

by:
steelseth12 earned 500 total points
ID: 20303356
at the end of every generate page you could call flush()
http://www.php.net/manual/en/function.flush.php
to output the buffer to the browser .
I also use fpdf but if performance is a big issue to you, then you should consider using pdflib which is faster than fpdf
http://www.php.net/manual/en/ref.pdf.php
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now