Solved

Fastest serve of generated PDF file....

Posted on 2007-11-16
1
593 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

932 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

10 Experts available now in Live!

Get 1:1 Help Now