using WordPress 3.8, i included dompdf library to generate portfolio of my site, i tried in different ways but got no solution. here is my code i tried.
<?php
require_once ('dompdf/dompdf_config.inc.php');
$id="80";
$post = get_page($id);
$contents = apply_filters('the_content', $post->post_content);
$html =
'<html><body>'.
'<p>Put your html here, or generate it with your favourite '.
'templating system.</p>';
$html.= $contents;
$html .='</body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("Dotcom Portfolio.pdf");
}
?>
Not: when i echo $contents variable , it prints the data which is stored in it.like
$post = get_page($id);
$contents = apply_filters('the_content', $post->post_content);
echo $contents;
die();
but not storing in $html variable convert in PDF.
thanks in advance.
Try this steps
And the config:
(dompdf_config.custom.inc)