• 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

storagelogs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

Yii Ajax Submit button

How to insert data from multiple select dropdown values into database?

Store multiple fields in JSON column (Nova CMS)

Using Associative arrays

get folder directory from input type file - PHP

Dynamic dropdown Ajax PHP request

Laravel 8 Multiple Relationships for Factory

How to Install Composer Require doctrine/dbal

XML to CSV with PHP converter [problem with images grabing]

How to run or debug php on Visual Studio Code (VSCode)

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

How to convert the int value to inch in PHP [closed]

No result using makeStyles Material UI in react 18

How can I get user id from session in javascript?

About Contact Privacy policy Terms and conditions