• 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

PHP password_verify

How to show a popup modal in codeIgniter?

Pages are working fine on localhost but not running on the hosting server

php file upload scanning using clamav, permissions on /tmp/

Laravel: Create morphs() relationship nullable

Laravel 5 session not persisting after user is logged in

jwt decode throws Invalid argument supplied for foreach() on php-jwt and codeignitor 4

Increase value by 1 on button click

php curl requesting twice

Cannot pass null argument when using type hinting

PHP rotate matrix counter-clockwise

Xdebug in Laravel is not working with VSCode

Woocommerce product attributes with hierarchy like categories

Error Class "LaravelFortifyFeatures" not found

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

About Contact Privacy policy Terms and conditions