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, 2022 in Others by Soham
• 9,710 points
4,127 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, 2022 by Aditya
• 7,680 points

Related Questions In Others

0 votes
2 answers
0 votes
1 answer

Uipath(RPA) : read data from the PDF file and write to Excel file

If you want to use UiPath and ...READ MORE

answered Oct 17, 2022 in Others by narikkadan
• 63,720 points
2,080 views
0 votes
1 answer

Spire When Pdf-ing an excel file it leaves some formulas as System.Object[][]

Since you tested the Excel file and ...READ MORE

answered Nov 25, 2022 in Others by narikkadan
• 63,720 points
927 views
0 votes
1 answer

How can I convert excel file to pdf using TCPDF?

PHPExcel can only read charts from Excel2007 ...READ MORE

answered Oct 21, 2022 in Others by narikkadan
• 63,720 points
2,015 views
+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
1,441 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
11,275 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,670 points
4,345 views
0 votes
1 answer

Web API Error - This request has been blocked; the content must be served over HTTPS

 If your web app is being hosted ...READ MORE

answered Feb 16, 2022 in Others by Aditya
• 7,680 points
35,255 views
0 votes
1 answer

Arduino IDE can't find ESP8266WiFi.h file

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

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