• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to fix 'Data has already been sent to output, unable to output PDF file' in MPDF

phppdf-generationmpdf


PHP Snippet 1:

ob_start();

PHP Snippet 2:

ob_end_flush();

require_once __DIR__ . '/vendor/autoload.php';

$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML($html);
$mpdf->Output();

Related Snippets

Laravel views are showing from cache on one server but works fine on other server

Laravel 5.1 how to use {{ old('') }} helper on blade file for radio inputs

How to Display Data in Yajra Datatables Laravel 7?

Attempted to call an undefined method named "get" of class "MailController"

Correct way to use LIKE '%{$var}%' with prepared statements?

Uploading video to Youtube using Youtube Data API V3 and Google API Client PHP -- getting 401 (unauthorized) message

I want to store data in new index as per my key in php [duplicate]

Insert database rows from columns of data from associative array of indexed arrays

php file upload scanning using clamav, permissions on /tmp/

PHP: How to solve ob_start() in combination imagepng() issue?

IlluminateDatabaseQueryException could not find driver [duplicate]

Laravel : How to Create Dropdown to Select FOREIGN KEY from Other Table?

Convert string to lowercase AND then convert it to its original form in PHP, is it possible?

Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in

Can we define variables in `.tpl` files?

About Contact Privacy policy Terms and conditions