TCPDF ERROR: Some data has already been output, can't send PDF file

  • Posts: 159
  • Thank you received: 2
5 years 1 month ago #304041

-- HikaShop version -- : 4.0.2
-- Joomla version -- : 3.9.3
-- PHP version -- : 7.2

Hi,
if I want to generate an invoice from the order list or within an order, I receive the following error code:

TCPDF ERROR: Some data has already been output, can't send PDF file

Could it be an PHP issue? The server works on 7.2 now. With PHP 7.0 it worked fine.

Thanks for your help
Roger

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
5 years 1 month ago #304044

Hi,

This means that something displays an error message on the page before the plugin can display the PDF.
Turn off the "error reporting" setting of the Joomla configuration and that should make it work as the PHP errors won't appear on the website pages anymore, only in the logs (which is what you want to do anyways on a live website to avoid security issues with information leakage due to unexepected error messages).

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

  • Posts: 159
  • Thank you received: 2
5 years 1 month ago #304056

Thanks Nicolas, that helped.

Is there a way to export all invoices of a specific month as single PDF files? I can filter all orders and click on invoice, but it will give me one PDF with all selected orders in one PDF file. My bookkeeping wants to have them as single PDF files, without saving every single order.

Thanks
Roger

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
5 years 1 month ago #304058

Hi,

You could potentially give them a copy of the order status notifications ( the email that the customer receives with the PDF invoice as attachment ) by adding your bookkeeper email address in the BCC field of the email via the menu System>Emails.
Otherwise, once you get the PDF with all the invoices, you could use a tool to cut the PDF in separate PDFs. PDF Sam is a free and open source tool you can use to do just that: pdfsam.org/

The following user(s) said Thank You: Rokell

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

  • Posts: 159
  • Thank you received: 2
5 years 1 month ago #304069

Thanks for the link to the PDF program. I already send the invoice to the bookkeeping with every order. Sometimes we do special deals and receive hundreds of orders a day. For this amount it would be helpful to have the invoice PDFs stored somewhere on our server to download them once a month. Maybe that could be a feature for a future release.
Thanks
Roger

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
5 years 1 month ago #304104

Hi,

We sure could add an option to store the invoice PDFs.
In fact, they are already stored in the folder plugins/hikashop/attachinvoice/invoices/ but they are deleted automatically to avoid having the folder grow for no reason.
So adding an option to not delete them shouldn't be a problem.
In fact, if you want to do that right now, just remove the line:
JFile::delete($invoiceFolder.DS.$oneInvoice);
in plugins/hikashop/attachinvoice/attachinvoice.php and you'll get the invoices stored in that folder.

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

Time to create page: 0.057 seconds
Powered by Kunena Forum