Attach Invoice Generates TCPDF ERROR

  • Posts: 166
  • Thank you received: 9
  • Hikashop Business
5 months 1 day ago #327183

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.23

Hi,

I installed the Attach Invoice plugin, but when I click "Invoice" or "Shipping Invoice" in the order I get an error: TCPDF ERROR: Some data has already been output, can't send PDF file



Also on all the other locations where the PDF invoice can be generated, I get the same error.

Hope you can help me with this problem!

Regards

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 72738
  • Thank you received: 11090
  • MODERATOR
5 months 1 day ago #327188

Hi,

This means that a notice or warning has already been sent to the browser before the plugin generates the PDF.
If you turn off the "error reporting" setting in the Joomla configuration is should prevent the problem.
Now the question is where is this notice/warning.
And that's hard to say as the notice/warning is not displayed because of the error from the TCPDF library.
The notice/warning should be logged in the error log of your PHP. So the best would be to monitor that log while you reproduce the problem.
What you can try is to add the code:
ob_clean();
before the line:
$html2pdf->Output($fileName.'.pdf','D');
in the file plugins/hikashop/attachinvoice/attachinvoice.php
That should remove the notice/warning message from the ouput buffer which should prevent TCPDF from stopping and displaying that error.

The following user(s) said Thank You: Rixters

Please Log in or Create an account to join the conversation.

  • Posts: 166
  • Thank you received: 9
  • Hikashop Business
5 months 12 hours ago #327256

Hi,

Thanks for the fix!

This is probably something you have to patch yourself in the plugin also. Relying on the customer having the Error Reporting on none is not the way to go ;)

Please Log in or Create an account to join the conversation.

  • Posts: 72738
  • Thank you received: 11090
  • MODERATOR
5 months 5 hours ago #327263

Hi,

Yes. We'll add that patch on our end. I first wanted your feedback to make sure it does the job.

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum