• 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

Minimum order amount except for specific shipping method in WooCommerce

500 (Internal Server Error) with Laravel & Docker [duplicate]

backup files to google drive using PHP

zsh: command not found: php

*** ERROR *** The PHP configuration loaded file is: c:/wamp64/bin/php/php8.1.0/php.ini - should be: c:/wamp64/bin/apache/apache2.4.53.1/bin/php.ini

How Can I Do LIMIT 1, 2 In WP_Query

PHP: Insert marker every 3 iterations

mysql_result is defined but mysql_free_result warns it expected a resource

dockerizing Laravel + vue

Saving Data from form to database using AngularJS and php

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

How to delete old images from public folder on update using Laravel

Normalize DateInterval in PHP

How to change 'users' auth table and use another instead Laravel

OctoberCMS / Anonymous Global Scope

About Contact Privacy policy Terms and conditions