• 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 Sanctum CSRF not authenticating

How do I Post to .txt document before form submits

JQuery content editable div and text box on submit not sending POST

How to update array value in Laravel

Saving Data from form to database using AngularJS and php

Combine multiple columns into an array as one of the key in a results set

Why does array_map() with null as callback create an "array of arrays"?

Laravel 5.2: Unable to locate factory with name [default]

Undefined variable in Laravel 8 project (php 7.4)

Laravel Displaying image from database

How to solve Duplicate entry '0' for key 'PRIMARY' in Wordpress?

PHP 8.1: strftime() is deprecated

ldap is missing from system when installing adldap2 in laravel

Converting array to string and then back in PHP

Getting values for an enum?

About Contact Privacy policy Terms and conditions