• 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

Add and update products to session cart in Laravel

file_get_contents() without "Http" to access external URL [closed]

Remove country code from phone number?

Symfony run hint kernel.secret parameter not found

SilverStripe unable to populate multiple member Childs

How to debug in WooCommerce 3+

Mysqli Output to a table

Appending data to an anchor tag

How can I get user id from session in javascript?

Remove categories with all childs derived from parent category

Xdebug in Laravel is not working with VSCode

Dropdown with current value from Mysql

Add customer email and phone in "Order" column to admin orders list on Woocommerce

Make Shipping Method fields Mandatory on Woocommerce checkout page

Laravel PHP: multiple project run at the same time [closed]

About Contact Privacy policy Terms and conditions