Jump to content

tcpdf and images


tommy2shoes

Recommended Posts

Hi

 

I am trying to add an image to a pdf file created using tcpdf. Part of the code I have to date is:

 

$pdf->AddPage();

// create some HTML content

 

 

$htmlcontent = "<html>

<strong>THIS IS AN EXAMPLE TITLE<br></strong>             

<p> This just some straight text that I've added to see what happens This just some straight text that I've added to see what happens This just some straight text that I've added to see what happens This just some straight text that I've added to see what happens This just some straight text that I've added to see what happens </p>

<ol>

<li>This is some example text for testing. <br> </li>

<li>This is some example text for testing.</li> </ol>

  ";

 

// output the HTML content

$pdf->writeHTML($htmlcontent, true, 0, true, 0, '');

 

I have a logo which is in a folder and can be found at

../img/logo.png

 

What I would like to do is have the image in the centre of the page before all of the text but whatever I've tried has failed. Any suggestions/answers would be much appreciated.

 

Also I've failed at centering the title - any ideas on that.

 

Many thanks.

Link to comment
https://forums.phpfreaks.com/topic/232393-tcpdf-and-images/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.