create simple html2 pdf document.

create on file with ex.php

and type some code.

<page>

<span>hello</span>

<br>

hitesh

</page>

now save this file.

and create another file with name ex1.php

and write some code there

<?php

ob_start();

include(‘ex.php’);

$content=ob_get_clean();

require_once(‘html2pdf.class.php’);

try{

$html2pdf=new HTML2PDF(‘P’,’A4′,’fr’);

$html2pdf->setDefaultFont(‘Arial’);

$html2pdf->writeHTML($content,isset($_GET[‘vuehtml’]));

$html2pdf->Output(‘example.pdf’);

}

catch(HTML2PDF_exception $e){

echo $e;

}

?>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s