PHP Classes

how to add images to the chapters in epub

Recommend this page to a friend!

      EPub  >  All threads  >  how to add images to the chapters in...  >  (Un) Subscribe thread alerts  
Subject:how to add images to the chapters in...
Summary:how can i add images to the chapters in epub?
Messages:3
Author:Sarin Cm
Date:2013-10-08 12:26:40
Update:2013-10-15 04:09:17
 

  1. how to add images to the chapters in...   Reply   Report abuse  
Picture of Sarin Cm Sarin Cm - 2013-10-08 12:26:40
hi

this class is very helpful for me,many many thanks for such a good class,
now i am working in epub generation using this class,now my problem is i want to add images(.png) between chapters.
$book=$obj->addFile($filename.".png","arabic",file_get_contents($filename.'.png'),"image/png");
i added the file to be inserted in zip,what should i do next??
plz help me.
thanks in advance

  2. Re: how to add images to the chapters in...   Reply   Report abuse  
Picture of Asbjorn Grandt Asbjorn Grandt - 2013-10-11 17:41:59 - In reply to message 1 from Sarin Cm
You need to add the <img> tag to the chapter HTML.

In your example you add the image as $filename.".png", so the image tag in teh html will have to contain the same name in the src attribute. essentially:
<img src="$filename.png"/>

The other way of doing it, is to have the html reference the image on the server, as seen in the example, and then have EPub add it for you.

  3. Re: how to add images to the chapters in...   Reply   Report abuse  
Picture of Sarin Cm Sarin Cm - 2013-10-15 04:09:17 - In reply to message 2 from Asbjorn Grandt
thank you very much for the replay,this class is very helpful for me in epub generation,thanking you again for such a great class