• 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

codeigniter 4 running error first time with xampp

How in Laravel run JavaScript code stored in php variable?

How to KeyBy where multiple items have the same key

Composer Script echo

What is the function of the (new Date()).getTime() in PHP?

Access relation of pivot table in Laravel

PHPExcel How to set conditional formatting to change cell background color based on cells values

JSON Render Issue in Date Object Laravel and PHP 7.4

Laravel no logout option from menu after successfull login

WordPress Security Standards want me to escape my html, but how to do it correctly?

How to create laravel storage symbolic link for production or sub domain system?

Can we define variables in `.tpl` files?

Phpunit partial mock + proxy Entity

Change the alert text on add to cart action without selected variation in Woocommerce

Attempt to read property "view" on null when sending password reset email

About Contact Privacy policy Terms and conditions