Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8022359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:14:49+00:00 2026-06-04T22:14:49+00:00

I am generating a PDF on the fly, this take upto several seconds, what

  • 0

I am generating a PDF on the fly, this take upto several seconds, what I would like to do is get the browser to start the download before the pdf is generated so the user isn’t sitting around wondering if it is working.

Idea I had is to flush the headers then generate and output the pdf, however I can’t flush without something to flush.
So would a space at the beginning affect/invalidate the pdf file. ie ” %PDF-1.4″ instead of “%PDF-1.4”

Its PHP5.2 using the Zend pdf generator.

Update

As far as I can tell it does not affect the readability of the pdf, but it also doesn’t make any difference to IE.

So the best solution would be to do a download site style holding page which just meta-refeshes or js-redirected to the actual pdf generation script.

Or perhaps This nice little hack

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T22:14:51+00:00Added an answer on June 4, 2026 at 10:14 pm

    There is no meaningful way for downloading empty data and then the real file, which would be to start downloading early.

    I would suggest to display some animation that the PDF file is being prepared and that the download will start in no time. This way, the user knows that something is happening (while the animation keeps him from thinking that the browser froze/crashed) and you can transfer the file the usual way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am generating a pdf using iTextSharp. I would like to display it on
I'm automatically generating a PDF-file with Platypus that has dynamic content. This means that
I'm working with generating .pdf's from PHP using this library: http://www.fpdf.org/ I am currently
We are running tomcat, and we are generating pdf files on the fly. I
I've searched a lot but could not solve this problem. I am generating PDF
I'm generating PDF documents with PDFKit and I'd like to have it not embed
What would be a solid tool to use for generating PDF reports? Particularly, we
I read several articles on this site and many others recommending report generating tools
I know this has been asked before, but I'm still undecided on which PDF
I am using the FPDF library for generating PDF files by PHP. This library

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.