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

0 votes

I keep receiving this error when trying to add my own array into the code. Here is my array;

$array = array(); 
while (odbc_fetch_row($rs)) 
{ 
$array[] = odbc_result($rs,'Product Name'); 
} 
$test = print_r($array);

This code is before the $html variable and when it is set I just add the $test variable into the $html variable. The odbc connection works fine and the example works fine before I add any code but when I run the script I get this error;

Array ( [0] => Test1 [1] => Test2 ) TCPDF ERROR: Some data has already been output, can't send PDF file

And also, are there also more than 2 items included in the Array. Any ideas?

Feb 16 in Others by Soham
• 8,730 points
20 views

1 answer to this question.

0 votes

To answer your question, do add the function ob_end_clean(); before calling the Output function. It worked for me within a custom Wordpress function!

ob_end_clean(); $pdf->Output($pdf_name, 'I');

answered Feb 16 by Aditya
• 7,280 points

Related Questions In Others

0 votes
2 answers
0 votes
1 answer

Error: No pubspec.yaml file found.

Hi@akhtar, You need to run this command from ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,360 points
6,175 views
0 votes
1 answer
+1 vote
2 answers

Scp Php files into server using gradle

Tru something like this: plugins { id ...READ MORE

answered Oct 11, 2018 in DevOps & Agile by lina
• 8,220 points
526 views
0 votes
1 answer

How do I create folder under an Amazon S3 bucket through PHP API?

Of Course, it is possible to create ...READ MORE

answered Apr 24, 2018 in AWS by anonymous
9,155 views
0 votes
1 answer

Failure uploading Image on AmazonS3 with PHP SDK

Try this, I took it out from ...READ MORE

answered May 4, 2018 in AWS by Cloud gunner
• 4,660 points
2,126 views
0 votes
1 answer

Trying to call AWS API via PHP

Try using AWS SDK for PHP, Link ...READ MORE

answered Jun 6, 2018 in AWS by Cloud gunner
• 4,660 points
981 views
0 votes
1 answer
0 votes
1 answer

Arduino IDE can't find ESP8266WiFi.h file

Customisation and selection of the correct card ...READ MORE

answered Feb 16 in Others by Aditya
• 7,280 points
20 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP