Jump to content

FPDF error: Some data has already been output, can't send PDF file


Recommended Posts

Bonsoir/Bonjour,

Que signifie : " FPDF error: Some data has already been output, can't send PDF file " lorsque l'on est dans la partie client (connecté avec un compte fictif donc en tant que client) et que l'on veut afficher la facture ?

Google {(mon ami :)} traduit cela par : " FPDF error: Certaines données ont déjà été la production, ne peuvent pas envoyer de PDF fichier ".

Merci de vos avis éclairés !

Share this post


Link to post
Share on other sites

  • 2 weeks later...

j'ai le même probleme.... avec mes clients qui ne peuvent pas ouvrir leur fichier pdf...
par contre du coté du back office tout est OK ! les fichiers pdf s'ouvre correctement et je fais un mail au client avec facture en piece jointe...

mais je cherche toujours...
quelqu'un a une idée !!!

le message apparait à la tentative d'ouverture du fichier pdf de la part du client à partir de son compte...

Share this post


Link to post
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
SOLVED
Just replace your v1.1.0.5 classes/Validate.php with some newer (1.2 RC1 i.e.) Worked for me :)


Hi,


still not working for me(FPDF error: Some data has already been output, can't send PDF file),is there any setting that I've missed?

Share this post


Link to post
Share on other sites

SOLVED
Just replace your v1.1.0.5 classes/Validate.php with some newer (1.2 RC1 i.e.) Worked for me :)


Hi,


still not working for me(FPDF error: Some data has already been output, can't send PDF file),is there any setting that I've missed?



Try check ADMIN > Preferences > PDF ... otherwise i have no idea at the moment. That my solution worked for some people...

Best regards

Share this post


Link to post
Share on other sites


Try check ADMIN > Preferences > PDF ... otherwise i have no idea at the moment. That my solution worked for some people...

Best regards


Hi metamorpher,

may I know which encoding to make it works?

Thanks in advance
Best regards

Share this post


Link to post
Share on other sites

  • 3 weeks later...

Hello,
I have checked pdf-invoice.php and admin/pdf.pdf and find out there is no "include(dirname(__FILE__).'/init.php');" in admin/pdf.php.
So I comment it and it works !! But I don't know if it's a good solution ...

Share this post


Link to post
Share on other sites

Hello,

the file "pdf-invoice.php" is in the root of the website, just change line 4 :

<?php

include(dirname(__FILE__).'/config/config.inc.php');
include(dirname(__FILE__).'/init.php');



in

<?php

include(dirname(__FILE__).'/config/config.inc.php');
//include(dirname(__FILE__).'/init.php');



Hope it works for you :-)

  • Like 1

Share this post


Link to post
Share on other sites

this usually caused by some whitespace after the closing php ?> tag

check you files for any extra line breaks and whitespace after the closing php ?> taG


REGARDS



cHRIS



Hi Christ,

which files should I check?
thanks in advance

Share this post


Link to post
Share on other sites

  • 6 months later...
  • 8 months later...
I had the same problem. I fixed it by putting @ before the two ini_set lines in the fpdf file.


Oh my god! Thank you so much. I've been losing sleep over the error & u solved it for me! Mine was a little different error, it kept saying file was damaged & couldn't be opened.

Share this post


Link to post
Share on other sites

  • 4 weeks later...

I had this problem before for the front end and fixed it by doing

function Output($name='', $dest='')
{

   ob_clean();



on line 993 in the tools/fpdf/fpdf.php

ob_clean basically cleans all the content & headers from a page.



But now I have a problem when i try to export a invoice from the Backend it says the same FPDF error: Some data has already been output, can’t send PDF file .

Any one have any solution to this

  • Like 2

Share this post


Link to post
Share on other sites

  • 2 weeks later...
Hello,

the file "pdf-invoice.php" is in the root of the website, just change line 4 :

<?php

include(dirname(__FILE__).'/config/config.inc.php');
include(dirname(__FILE__).'/init.php');



in

<?php

include(dirname(__FILE__).'/config/config.inc.php');
//include(dirname(__FILE__).'/init.php');



Hope it works for you :-)




It works!!!! God bless you!! thanks for sharing this information a year a go!!!!

Share this post


Link to post
Share on other sites

  • 2 weeks later...
  • 5 months later...

Hello,

you can active debugging mode in config/config.inc.php file to show the real error message.

in the config.inc.php file put display_errors to on

@ini_set('display_errors', 'on');



Then real php error would be something like that

Warning: Cannot modify header information - headers already sent by (output started at /home/ftp/www/tools/fpdf/font/helveticab.php:31)


which indicates that line 31 of helveticab.php (it's just an example) is wrong.

You have just characters after the "?>" php end tag.

look at FDF FAQ

Correct the file deleting character after php end tag and all works fine.

Manu

Share this post


Link to post
Share on other sites

  • 1 month later...

I had this problem before for the front end and fixed it by doing<br/><br/>

function Output($name='', $dest='')<br/>{<br/>    <br/>    ob_clean();

<br/><br/>on line 993 in the tools/fpdf/fpdf.php<br/><br/>ob_clean basically cleans all the content & headers from a page.<br/><br/><br/><br/>But now I have a problem when i try to export a invoice from the Backend it says the same FPDF error: Some data has already been output, can’t send PDF file . <br/><br/>Any one have any solution to this

 

Your solution with ob_clean worked for me in FO, but not in BO. But I think I have found my source of error and I have a solution for it. I used dreamweaver to edit my pages, never had problems with it. Now I tried another program called phase5. When I edit a php-file, it seems that phase5 deletes the php end tag (?>) at the very end of the source code. The error message in BO said that something was wrong with my cookie.php. I edited this file for a few days ago, to set the cookie session time from 20 days to 3 hours - with phase5. So I opened the file in dreamweaver and voila, no php end tag. After I added the end tag to it - it worked.

Share this post


Link to post
Share on other sites

  • 10 months later...

Hello,

 

the file "pdf-invoice.php" is in the root of the website, just change line 4 :

 

<?php

include(dirname(__FILE__).'/config/config.inc.php');
include(dirname(__FILE__).'/init.php');

 

in

 

<?php

include(dirname(__FILE__).'/config/config.inc.php');
//include(dirname(__FILE__).'/init.php');

 

Hope it works for you :-)

 

 

THANK YOU! This worked!

 

Att. Julio

Share this post


Link to post
Share on other sites

  • 1 year later...

I had this problem before for the front end and fixed it by doing

 

function Output($name='', $dest=''){        ob_clean();

on line 993 in the tools/fpdf/fpdf.php

 

ob_clean basically cleans all the content & headers from a page.

 

 

 

But now I have a problem when i try to export a invoice from the Backend it says the same FPDF error: Some data has already been output, can’t send PDF file .

 

Any one have any solution to this

 

 

Thanks a lot, this solution works great.

Just a mention, in PS version 1.4.7, replace line 994 

{

 with  

{ ob_clean();

Share this post


Link to post
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More