• 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

Attempt to read property "view" on null when sending password reset email

PHP sort array of objects by two properties

Printing more than one array using print_r or any other function in php

how to search for a file with php

PHP using str_starts_with for array to exclude same as with wildcard

Laravel websockets AWS EC2 - Connection failed

auth pages not getting css in laravel

Transpose and flatten multiple rows of array data [duplicate]

How to skip cart page on woocomerce for certain products only?

How to pass data to all views in Laravel 5?

PHP and WebView - Cookie doesn't are the same

Transfer data between JavaScript and PHP through JSON

(Laravel) How to delete multiple models including optional relationships?

I can't delete my image when it is liked because of the foreign key in mysql

How to get quarter for future date using Carbon?

About Contact Privacy policy Terms and conditions