• 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) How to delete multiple models including optional relationships?

Using PHP to connect to a remote MSSQL database

how to see if database exists with PDO [duplicate]

How to loop a tree array with unknown depth and get array blocks?

phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed. WHAT?

dockerizing Laravel + vue

Unit (real unit test) of test laravel relationship

How to retrieve Active Directory group policy maximum password age using LDAP

Destroy session upon refresh

Star rating with half star support

Laravel : How to Create Dropdown to Select FOREIGN KEY from Other Table?

Why "Class 'GuzzleHttpClient' not found" even after Installing it in Laravel?

PHPS source file - 403 Forbidden You don't have permission to access this resource

How to keep value of selected value after form submission?

Convert regular text to array using notepad++

About Contact Privacy policy Terms and conditions