Buon giorno a tutti. (Spero di non aver sbagliato sezione)
Ho un piccolissimo problema con un'immagine che dovrebbe farmi visualizzare nel documento pdf una volta cliccato sull'aposita icona.
Mi restituisce questo errore:
Se jpg
TCPDF error: Missing or incorrect image file:
www.sinergiecommerciali.com/components/com_chronocontact/uploads/TFProva/20110303195811_210721.jpgSe bmp
TCPDF error: Unsupported image type: bmp
Se png
TCPDF error: Can't open image file:
www.sinergiecommerciali.com/components/com_chronocontact/uploads/TFProva/20110315092344_bigle2.pngAd ogni modo non mi fa visualizzare alcun formato...
Ho modificato il mio view.pdf.php in modo da andare a stamparmi una tabella con un'immagine presa tramite un'url in una cella del DB che ho creato..
Il file view.pdf.php l'ho modificaot in questo modo:
class ContentViewArticle extends JView
{
function display($tpl = null)
{
global $mainframe;
$user =& JFactory::getUser();
$dispatcher =& JDispatcher::getInstance();
// Initialize some variables
$article = & $this->get( 'Article' );
$params = & $article->parameters;
// Create a user access object for the current user
$access = new stdClass();
$access->canEdit = $user->authorize('com_content', 'edit', 'content', 'all');
$access->canEditOwn = $user->authorize('com_content', 'edit', 'content', 'own');
$access->canPublish = $user->authorize('com_content', 'publish', 'content', 'all');
// Check to see if the user has access to view the full article
$aid = $user->get('aid');
if (($article->access > $aid) && ( ! $aid )) {
// Redirect to login
$uri = JFactory::getURI();
$return = $uri->toString();
$url = 'index.php?option=com_user&view=login';
$url .= '&return='.base64_encode($return);;
//$url = JRoute::_($url, false);
$mainframe->redirect($url, JText::_('You must login first') );
}
else if ($article->access > $aid) {
$document = &JFactory::getDocument();
$document->setTitle($article->title);
$document->setHeader($this->_getHeaderText($article, $params));
echo '<h1>' . JText::_('ALERTNOTAUTH') . '</h1>';
return;
}
// process the new plugins
JPluginHelper::importPlugin('content', 'image');
$dispatcher->trigger('onPrepareContent', array (& $article, & $params, 0));
$document = &JFactory::getDocument();
// set document information
$document->setTitle($article->title);
$document->setName($article->alias);
$document->setDescription($article->metadesc);
$document->setMetaData('keywords', $article->metakey);
// prepare header lines
$document->setHeader($this->_getHeaderText($article, $params));
echo '<table align="center" border="1" bordercolor="#ffffff">
<tr><th colspan="4" scope="col"><img align="center" height="200" width="266" alt="file" src="www.sinergiecommerciali.com/components/com_chronocontact/uploads/TFProva/'.$article-> imm_2.'"></th></tr>
<tr align="center"><th width="400" scope="row" colspan="4" bgcolor="#000000"><FONT COLOR="#ffffff">AUTOTELAIO:'.$article-> title.'</FONT></th></tr>
<tr><th scope="row" bgcolor="#3399FF"><FONT COLOR="#ffffff">Anno</FONT></th><td>'.$article-> anno_3.'</td>
<th scope="row" bgcolor="#3399FF"><FONT COLOR="#ffffff">Km</FONT></th><td>'.$article-> km.'</td></tr>
<tr><th scope="row" bgcolor="#3399FF"><FONT COLOR="#ffffff">Ore di lavoro</FONT></th><td>'.$article-> oredilavoro.'</td>
<th scope="row" bgcolor="#3399FF"><FONT COLOR="#ffffff">Assi</FONT></th><td>'.$article-> assi.'</td></tr>
<tr align="center"><th width="400" scope="row" colspan="4" bgcolor="#000000"><FONT COLOR="#ffffff">AUTOTELAIO:'.$article-> title.'</FONT></th></tr>
</table>';
}
Scusatemi, ma non ne riesco a venire a capo... ho già pure provato a risolvere il bug degli spazi.. ma non era quello.(forse era un po' ovvio che non poteva essere quello)
Grazie per la vostra attenzione, come sempre.
Spero che riusciate ad aiutarmi. Saluti,