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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.