How to Generate thumbnail from HTML

3 views
Skip to first unread message

Umar

unread,
Oct 29, 2008, 8:01:43 AM10/29/08
to camp-k...@googlegroups.com

In the name of Allah, the Most Gracious, the Most Merciful, the All-Compassionate

"May the Peace and Blessings of Allah be Upon You"

As-Salaam Alaikum Wa-Rahmatullahi Wa-Barakatuhu


Hi


I need to  create thumbnail images from HTML on the fly in php

The HTML is stored in database not the URL

I have scripts in php which creates thumbnails of websites by providing their URL but here I need to provide the HTML


can any one from this group help me or provide some reference sites


Thanks
Qazi Umar Adil
Message has been deleted
Message has been deleted
Message has been deleted

Owais Lone

unread,
Nov 24, 2008, 3:24:42 AM11/24/08
to Camp Kash IT
A possible solution would be to save the html to a string & write the
string to a file on the server.
Then point your PHP Script to the file.

Do let me know if it works.

Owais Lone

unread,
Nov 24, 2008, 3:27:41 AM11/24/08
to Camp Kash IT
My PHP experience is just a few days old...So excuse me if that's a
stupid idea. ;-)

Umar

unread,
Nov 24, 2008, 3:55:04 AM11/24/08
to camp-k...@googlegroups.com

In the name of Allah, the Most Gracious, the Most Merciful, the All-Compassionate

"May the Peace and Blessings of Allah be Upon You"

As-Salaam Alaikum Wa-Rahmatullahi Wa-Barakatuhu



Thanks Owais


The best solution I find is :

I converted the HTML file to PDF then used image magik  to get the thumbnail of the PDF Document.

Here is the code:

function convertPDFIntoImages($filePath, $FileId, $wwwpath="")
{
    $cmd = "convert ".$filePath."/".$FileId.".pdf"." ".$filePath."/page".$FileId."_%d.jpg";
    //echo '<br>'.$cmd.'<br>';
    //die;
    system($cmd);
   
}
 
convertPDFIntoImages('/home/qaziumar/public_html/imagick/examples', 'CTS', $wwwpath="");




Thanks
Qazi Umar Adil


On Mon, Nov 24, 2008 at 1:35 PM, Owais Lone <lone...@gmail.com> wrote:

A possible solution would be to save the html to a string & write the
string to a file on the server.
Then pint your PHP Script to the file.


Do let me know if it works.

On Oct 29, 5:01 pm, Umar <qzi.u...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages