• 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

Reload parent page after submit in iframe

How to insert data from multiple select dropdown values into database?

Symfony redirect if already loggedin from login page

Artisan, creating tables in database

Add a text next to stock quantity if it is less than 10 in Woocommerce single product

Get image type from base64 encoded src string

how to fix Service provider class not found when using repository?

hidden INPUT value not available in $_POST

Insert a DIV after the 6th product only once in WooCommerce category archives

Load a .env file with PHP

Project structure for PHP

Destroy session upon refresh

PHPExcel_IOFactory::createWriter causes wrong behaviour

Why does array_map() with null as callback create an "array of arrays"?

Dynamic dropdown Ajax PHP request

About Contact Privacy policy Terms and conditions