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 7167231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:32:40+00:00 2026-05-28T14:32:40+00:00

I use FPDF to generate some PDF from a PHP. It worked great for

  • 0

I use FPDF to generate some PDF from a PHP. It worked great for small exemple but now i got a problem with it : it return some data which i saw in the console but no file !

ouput look likes – it’s the PDF no ?

%PDF-1.4
 0 obj
<</Type /Page
/Parent 1 0 R
/Resources 2 0 R
/Group <</Type /Group /S /Transparency /CS /DeviceRGB>>
......
<<
/Size 15
/Root 14 0 R
/Info 13 0 R
>>
startxref
22291
%%EOF

And my php is pretty long, here is a pastebin of it http://pastebin.com/ri5uAeie

My php looks correct, really weird no ?

UPDATE

I pass my param throw the URL and with a $_GET and it works well 🙂 Thanks for your help guys !

  • 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-05-28T14:32:41+00:00Added an answer on May 28, 2026 at 2:32 pm

    You’ve probably added a blank line somewhere, possibly at inc/DataLib.php.

    Update #1:

    According to your answers, there’s two suspicious points:

    1. The Content-Type should be application/pdf. In theory, the PDF::Output() method adds it for you (unless php_sapi_name() returns cli, which should not be possible in web environment).

    2. Getting a blank page in a desktop PDF reader (rather than an error) suggests that the document is damaged in a way that the reader cannot even detect it… or that the document is actually blank.

    No idea about #1 (firewall? proxy? antivirus?) but you could at least inspect the PDF source in search of PHP error messages or something that does not belong there.

    Update #2:

    I think I finally understood what your problem is. You cannot use JavaScript to retrieve a PDF file though AJAX. All JavaScript can do is:

    1. Manipulate the page’s DOM (and PDF is not HTML).
    2. Replace the complete DOM page with something else (and there’s no way to tell the browser what content-type it is).

    I suspect your PDF generator is just fine if you call it directly from the location bar.

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

Sidebar

Related Questions

I'm using fpdf library to generate some pdf files with php. At this moment
I'm working with generating .pdf's from PHP using this library: http://www.fpdf.org/ I am currently
I have tried to use the php script to generate PDF with a simple
I have a php file that I use to print pdf (using FPDF). In
Use case: I've just entered insert mode, and typed some text. Now I want
I am writing some PHP code to create PDFs using the FPDF library. And
I've read PDF Editing in PHP? but haven't found quite what I'm looking for.
I need to generate a pdf file by adding pages from an already generated
I tried to put an image in my pdf document, but when I use
I am using the FPDF library to build a PDF document based on some

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.