• 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 Command Schedule Not Working Properly

Laravel 5.1 xmlHttpRequest AJAX POST TokenMismatchException

Destroy session upon refresh

How to find phpcs current default standard

how to retrieve the first and last instance of a row in pdo dataset

How to disable only_full_group_by option in Laravel

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

How to remove index.php and index from the URL using htaccess | PHP

Navigation idle on content download

How do I remove this delivery notification from here?

CONCAT columns with Laravel 5 eloquent

merge all files in directory to one text file

PHP how to detect if running on arm64 cpu?

jwt decode throws Invalid argument supplied for foreach() on php-jwt and codeignitor 4

Laravel Unknown Column 'updated_at'

About Contact Privacy policy Terms and conditions