• 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

Jquery DataTables: Data not displaying in table via Ajax

PHP Slim Framework request using withAttribute error

Send Outlook 2010 email using PHP

Target Laravelista is not instantiable

Webscraping Symfony/Panther: Can't get HTML

Edit product hook WooCommerce

Unable to run composer install

How do I call Validator from a namespace with an already existing Validator class

Login if user is active using Laravel Breeze

How to change product Image when variables are selected in Shop and Archive Pages?

Using array_intersect on a multi-dimensional array

MOODLE: What does it mean to aggregate h5p assets?

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

Detect if PHP session exists

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource [duplicate]

About Contact Privacy policy Terms and conditions