Great to see a group!

Events happening in the community are now at Drupal community events on www.drupal.org.
robertdouglass's picture

Could you also pleas provide links to any external resources related to this project, such as the Project page on drupal.org, and any blog or wiki material that you may have written elsewhere? Thanks!

Comments

ajay1kumar1's picture

i made a separate module for add my additional process.

<?php
// Hook into the convert PDF to images and save it in database.

function convert_nodeapi($node, $op){ //echo $node->type;die;
if( ($op == 'insert' || $op == 'update') && $node->type == 'magazine'){
// echo "

"; print_r($node->field_pdf[0]);echo "

";echo $node->nid;

$fid = $node->field_pdf[0]['fid'];          // Source file id
$uid = $node->field_pdf[0]['uid'];          // user id 
$nid = $node->nid;                      // node id
$cdir = "sites/default/files/nodes/".$nid."/";      // current directory

// Create node directory if it is not exists //
if(!is_dir("sites/default/files/nodes/".$nid))
{
    exec("mkdir sites/default/files/nodes/".$nid);
}

// Convert pdf to png file in its node specified like  sites/default/files/nodes/2/page.png // 
$w = 500;
$args = array(0 => '-thumbnail '.$w);
_imageapi_imagemagick_convert($node->field_pdf[0]['filepath'], "sites/default/files/nodes/".$nid ."/page.png", $args) ;

//exec("convert -density 400 ".$node->field_pdf[0]['filepath']. " -scale 1000x500 sites/default/files/nodes/".$nid ."/page.png");

// Read all converted files from newly created node directory //
db_query("DELETE from {mag.convert_pdf}  WHERE fid='".$fid."'");
if ($handle = opendir("sites/default/files/nodes/".$nid)) {
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {

        db_query("INSERT INTO {mag.convert_pdf}  (nid ,fid ,file_name ,cpath ,full_path ,updated)VALUES ( '".$nid."', '".$fid."', '".$file."', '".$cdir."', '".$cdir.$file."',CURRENT_TIMESTAMP);");

        }
    }
    closedir($handle);

}
}

}

There is no setting you have to place in imagemagick with drupal 6.17 (i am using ubuntu OS), Just install imagemagick and configure (if req.)
Enjoy.......... Cheers

Ajay singh rathore.

SoC 2006: Imagemagick

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week