• 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

stay with the last 15 elements of an array [duplicate]

Yoast SEO (WordPress Plugin) - Get plugin generated data manually

java URL working on browser but not in client program

How to find phpcs current default standard

Jquery DataTables: Data not displaying in table via Ajax

Composer Script echo

Hide email address with stars (*)

Log a user out of a website when they put their computer to sleep

PHP - installing Xdebug on Mac with XAMPP (Unix File)

Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars'

PHP Include for HTML?

Entity provider not working in security.yml php symfony3.4 ({"code":401,"message":"bad credentials"}.)

Symfony 4: "Autowire: you should configure its value explicitly."

Call to undefined function openssl_decrypt

Insert a DIV after the 6th product only once in WooCommerce category archives

About Contact Privacy policy Terms and conditions