• 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/docker-compose/redis - Class 'Redis' not found

Sum array values

How to pass security cloudflare server with php curl

Last order would be re-order in wooCommerce. How is it possible?

Inserting data into SQL Server Db An Invalid direction was specified

Remove categories with all childs derived from parent category

how to remove white space in select 2

How to write PHP in XSLT

Adding the custom page with add_menu_page function on Wordpress

Woocommerce redirect after add-to-cart error

Adding one microsecond to Datetime object in PHP

Insert multidimensional array to codeigniter cart

Problems getting instance of UploadedFile in Yii2

Lexik JWT authentication problem "Invalid credentials"

SlimExceptionHttpNotFoundException

About Contact Privacy policy Terms and conditions