• 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

CodeIgniter force_download is not working

Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars'

How to change the app environment at run time?

Additional price based on cart item count in WooCommerce

How to fix " Uncaught TypeError: Argument 1 passed to JpGraphException::defaultHandler() " problem in php 7.1.3 and jpgraph 4.2.6?

Convert every two values of an associative array into key-value pairs

Issue with laravel eloquent model property

How to remove Deprecated SymfonyComponentDebugDebugClassLoader?

Apply filter array/return terms

LARAVEL: How to fetch id dynamically in a query builder?

printing all running session variable in laravel 5.1

Laravel insert dynamic input values with radio button

How to solve Duplicate entry '0' for key 'PRIMARY' in Wordpress?

PHP Print to Network Printer

PHP Imap , php 7.4.3 on mac osx catalina

About Contact Privacy policy Terms and conditions