Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

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

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › How to solve TCPDF ERROR: Some data has already been output, can't send PDF file

Tagged: estore, TCPDF Error

  • This topic has 10 replies, 4 voices, and was last updated 12 years, 7 months ago by Peter.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • October 4, 2012 at 8:05 am #7560
    carlodangio
    Member

    Hi,

    I’m using the Receipt Creator to easily manage my invoices. But I’m encountering an error when I see the pdf url:

    ===================================================================

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

    ===================================================================

    How can I solve this? Where I should look?

    Let me know please, thank you so much,

    Carlo.

    October 4, 2012 at 9:29 am #50034
    Peter
    Member

    Hi, Have you made any code modifications to the plugin?

    This issue can happen for a few reasons. One of them is if you have a plugin or theme that is doing output buffering in an incorrect way.

    October 5, 2012 at 2:03 am #50035
    wzp
    Moderator

    I’ve done some searching and the two most common sources for this error are:

    1. Some plugin modification that causes extra HTML to be outputted.

    2. Opening and then saving the PHP file in UTF-8 format instead of ANSI.

    October 5, 2012 at 8:06 am #50036
    carlodangio
    Member

    Hi and thank you for your kind reply.

    I have not edited any file of the plugin so I don’t know.

    Can the extra HTML outputted be caused by other files then the plugin? Maybe some function that I add as ‘init’ in the functions.php of the theme (since it’s a theme that I’ve created).

    Hope we can solve this problem, thank you.

    October 5, 2012 at 12:39 pm #50037
    wzp
    Moderator

    Try using the unmodified 2012 or 2011 WordPress theme. Basically, you have some extra output that is coming before the header gets sent. WordPress’s init hook should mainly be used to do initialization type tasks. You shouldn’t output any content in an init hook.

    November 16, 2012 at 9:39 pm #50038
    Leodore
    Member

    Hey There,

    I am having a similar kind of problem. When I upload an image to the receipt plugin and then try and view the receipt I get this error:

    TCPDF ERROR: [Image] Unable to get image: [http://unilotto.com/wp-content/uploads/2012/11/Unilotto-receipt-Logo.jpg]

    I have tried changing themes to default wordpress theme and disabling all other plugins except e-store plugin and receipt plugin but still keep running into this problem…

    Any suggestions would be greatly appreciated

    November 17, 2012 at 1:53 am #50039
    Peter
    Member

    @Leodore,

    Your problem could be server related.

    Ask your hosting provider if cURL is enabled.

    Also see this for some other things to look for and try:

    http://stackoverflow.com/questions/7665540/tcpdf-error-image-unable-to-get-image

    November 17, 2012 at 2:49 pm #50040
    wzp
    Moderator

    Go to eStore’s Admin functions area and look at the “Site Diagnostics” section. It will tell you if CURL is enabled or not.

    Another way of finding out if cURL is installed is to see if “Method 7, cURL” shows up in the eStore Download Method drop down menu. If it does not show up as a choice, it means cURL is not installed.

    November 17, 2012 at 10:06 pm #50041
    Leodore
    Member

    Thanks for the Tips…

    My server has curl present but I don’t think it is enabled so I have asked the tech support guys to enable it. Hopefully that will resolve the issue.

    Best wishes

    Leo

    November 17, 2012 at 10:53 pm #50042
    Leodore
    Member

    ok I have since heard back from tech support and they said:

    It is not possible to make a loopback connection on the server, which is where a script on the site tries to access an image on the same site, via cURL. The only way to circumvent this is to use the full server path (/home/sites/yoursite.com/public_html/wp-content/uploads/2012/11/your-image.jpg) to the image, and that should allow the script to access the image OK and use it.

    What do I need to modify in the plugin in order to achieve this please

    Leo

    November 19, 2012 at 12:10 am #50043
    Peter
    Member

    Hi again,

    I looked at the code and cURL is not actually being used for the logo image upload/display for the logo so I don’t think cURL is your problem. (sorry that was my mistaken assumption)

    However there is still obviously something unique to your server or installation which is preventing the image from displaying in the pdf.

    I will need to think more about this…..

    In the meantime can you please try the plugin conflict test – ie, disable all non-tips and tricks plugins and try printing a receipt.

    https://support.tipsandtricks-hq.com/forums/topic/test-to-identy-a-conflicting-theme-or-plugin

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ