I'll also give you another pretty good code to convert your wordpress page content in PDF.
I'm sure that some of you are interested on it !
so let's take the previous code (in my previous post).
At the very top of your document past that :
(at the very top because FPDF, modify "Header();", and they can not be even a "space" caracter before beginig the PDF document...)
$content = wp_get_page_content('page_id',6);;
if ( strtolower($_GET['mode'])=='pdf' )
$content = utf8_decode($content);
$pdf = new HTML2PDF('P','A4','US');
In the library file :
you have to past the previous function wp_get_page_content()
function wp_get_page_content( $type='page_id', $id=0 )
$_GET[$type] = (int)$id;
$wp_did_header = true;
if ( have_posts() )
while ( have_posts() )
$content = get_the_content();
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
return ( $content!=NULL )?$content:'';
You need the FPDF library and it's Class extends HTML2PDF freely dowloadable @ :
Now when you call your page in your favorite browser (and I'm prety sure it's firefox), add the GET parameter mode='PDF'
Test the result in real:
give you the normal customize page with wordpress content, (but you can not know it, as it's not a blog)
give you a PDF parsed "on-the-fly" with wordpress content (backward editable, with picture and all...).
Hope you'll enjoy it !