• 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

Select option from dropdown menu with PHP and mySql

How to use $this->session->set_userdata in codeigniter

Call to a member function givePermissionTo() on null

GRPC installed successfully on ubuntu but php is looking for it in another folder

How can I easily switch between PHP versions on Mac OSX?

What is PHP's equivalent of JavaScript's "array.every()"?

Put content of wordpress page inside div

Cross-Origin Resource Sharing (CORS) witth Laravel and Vuejs

Parameter is not sent to Laravel route in Ajax

How to validate Envato Purchase Code in PHP

How to send upload image through email

Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables 11 [closed]

Live search query using JS and PHP for QA forum

PHP if in_array() how to get the key as well?

Symfony there are no commands defined in the "make" namespace

About Contact Privacy policy Terms and conditions