• 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

How to reset Laravel AuthManager/guards in between API calls in tests?

Laravel insert dynamic input values with radio button

Cut an arabic string

What is the difference between client-side and server-side programming?

How to send parameters in soap request in php in __soapcall() function

How to add automatically collapse/expand in content wordpress (single.php)?

ldap is missing from system when installing adldap2 in laravel

Clients authentication and user authentication with laravel

How to use a PHP MVC Controller, one thats invoked by calling a URL, to call and execute more than one function? [duplicate]

php retrieve specific data onclick from database in a list format

PHP Include for HTML?

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

Last order would be re-order in wooCommerce. How is it possible?

Query Optimization, changing the queries in the loop into a single processing query

How Can I Do LIMIT 1, 2 In WP_Query

About Contact Privacy policy Terms and conditions