Hi all,
just wondering if anyone has done this i.e. used pdf.js as plugin. I am aware that there has been some discussions already on getting this to work on item level by adding some codes for the pdf.js (for viewing the pdfs) on show.php. That approach worked for us too. This is our code
<?php if (!$item) $item = get_current_record('item');
$files = $item->Files;
foreach($files as $file)
if ($file->getExtension() =='pdf'){
echo '<iframe width=100% height=800 src="http://xdeevy.nuim.ie/pdf.js/web/viewer.html?file=http://xdeevy.nuim.ie/files/original/'.metadata($file,'filename').'"></iframe>';
}
if($file->getExtension() !='pdf'){
fire_plugin_hook('public_items_show', array('view' => $this, 'item' => $item));
}
?>
But now we are wondering if making it a plugin (just like google doc viewer) would be better.
any thoughts?
Regards
Ranju