• 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

Laravel get user data with profile

javascript html popup window

how to upload binary image to sql server using php laravel

Group rows by column and sum another column within groups [duplicate]

Reload parent page after submit in iframe

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

How can I get a div content in php

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

PHP -> Next nearest date defined by array of days in week

Failed user login on production server using Symfony framework (Authentication request could not be processed due to...)

Laravel You requested 1 items, but there are only 0 items available

Best way to scrolldown onpageload

Refresh specific HTML content that retrieves data from MySQL

Undefined variable in Laravel 8 project (php 7.4)

SQL AVG() to 2 decimals

About Contact Privacy policy Terms and conditions