Closed jorisw closed 7 years ago
Hi,
I'm trying to do the most straightforward thing I can think of, which is simply output the entire page, as it would in HTML, to PDF.
In trying to achieve this, in wp-content/wp-mpdf-themes/default.php, I'm simply doing a require() of my template for this page type:
wp-content/wp-mpdf-themes/default.php
require()
<?php ob_start(); require_once(dirname(__FILE__).'/../themes/mytheme/single-posttype.php'); ob_flush();
However, something is still breaking wp-mpdf:
mPDF error: Some data has already been output to browser, can't send PDF file
The page is then displayed, in HTML, exactly as it's supposed to, but not as PDF.
What would be the right way to do this? Can I somehow return the output buffer to wp-mpdf as string?
Posting my question in the support forum instead.
Hi,
I'm trying to do the most straightforward thing I can think of, which is simply output the entire page, as it would in HTML, to PDF.
In trying to achieve this, in
wp-content/wp-mpdf-themes/default.php
, I'm simply doing arequire()
of my template for this page type:However, something is still breaking wp-mpdf:
The page is then displayed, in HTML, exactly as it's supposed to, but not as PDF.
What would be the right way to do this? Can I somehow return the output buffer to wp-mpdf as string?