• 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

php script to delete files older than 24 hrs, deletes all files

How to debug in WooCommerce 3+

Sum array values of a column within each column of an array with 3 levels

How can I pass the list to the component variable in Laravel?

How to solve cURL error 60: SSL certificate in Laravel 5 while Facebook authentication

get data-value with variable value

Too few arguments to function PendingResourceRegistration::name(),1 passed in C:xampphtdocsproject outesweb.php on line 18 and exactly 2 expected

php echo xml documents with header

Encrypt in php and decrypt in Dart(flutter)

I'm trying to write a clean url for my website using the $_SERVER['REQUEST_URI'] in php

Update Order custom Field value with WooCommerce REST API

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

HTTP Range requests with php for Video Embedding for solving going to specific time in video (seek bar not work)

Center point of multiple gps coordinates with php

Mysqli Output to a table

About Contact Privacy policy Terms and conditions