Attach Invoice Generates TCPDF ERROR

  • Posts: 189
  • Thank you received: 11
  • Hikashop Business
3 years 11 months 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: 82867
  • Thank you received: 13374
  • MODERATOR
3 years 11 months 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: 189
  • Thank you received: 11
  • Hikashop Business
3 years 11 months 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: 82867
  • Thank you received: 13374
  • MODERATOR
3 years 11 months 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.

  • Posts: 137
  • Thank you received: 8
  • Hikashop Business
3 years 3 weeks ago #336676

Hi Nicolas,

I noticed i get this error now that i am on a new server (no changes to joomla or hikashop to my knowlege).
I added the line of code and this works, only now there's a blank field that remains open in the order window (the popup after clicking invoice)
Is the patch for the invoice plugin only this line or are there any more improvements / changes?

Nico

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
3 years 3 weeks ago #336683

Hi,

There are other patchs.
I would recommend first to download again the PDF invoice plugin on our website and install it on yours (if your order is less than 4 years old, the download link you received is still working and will get you the latest version of the plugin).
We fixed an empty popup issue 6 months ago so it might be the problem you have.

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

  • Posts: 137
  • Thank you received: 8
  • Hikashop Business
3 years 2 weeks ago #336823

Hi, I downloaded it and joomla won't install it because the file size is too big.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
3 years 2 weeks ago #336828

Hi,

Unzip it on your local computer. Upload the files/folders in your Joomla tmp folder via FTP. And finally, use the "install from folder" option of the Joomla installer.
That will circumvent the upload limitation.
Otherwise, you can also check with your hosting how to increase the PHP upload limit on your website. Normally, it requires changing a parameter in the php.ini of the server.

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

Time to create page: 0.090 seconds
Powered by Kunena Forum