%PDF- %PDF-
| Direktori : /proc/self/root/proc/self/root/home1/lightco1/www/pdf/ |
| Current File : //proc/self/root/proc/self/root/home1/lightco1/www/pdf/html2fpdf_site.php |
<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/**
* @version $Id: html2fpdf_site.php 1821 2009-06-24 12:18:48Z soeren_nb $
* @package VirtueMart
* @subpackage HMTL2PDF
* @author Renato Coelho
* @copyright Copyright (C) 2004-2007 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
/*/////////////////////////////////////////////////////////////////////////////
//////////////DO NOT MODIFY THE CONTENTS OF THIS BOX//////////////////////////
//////////////////////////////////////////////////////////////////////////////
// //
// HTML2FPDF is a php script to read a HTML text and generate a PDF file. //
// Copyright (C) 2004 Renato Coelho //
// This script may be distributed as long as the following files are kept //
// together: //
// //
// fpdf.php, html2fpdf.php, gif.php, license.txt,credits.txt,htmltoolkit.php//
// //
//////////////////////////////////////////////////////////////////////////////
*/
class PDF extends HTML2FPDF {
function PDF() {
//! @return A class instance
//! @desc Constructor
//Call parent constructor
$this->HTML2FPDF();
//Disable some tags
$this->DisableTags("<big>,<small>");
//Disable <title>/CSS/<pre> in order to increase script performance
$this->usetitle=false;
$this->usecss=false;
$this->usepre=false;
}
//Common Logo for all HTML files (Montfort)
function InitLogo($src) {
global $mosConfig_live_site;
//! @desc Insert Image Logo on 1st page
//! @return void
if ($src == '') return;
$this->x = $this->lMargin;
$halfwidth = $this->pgwidth/2;
$sizesarray = $this->Image($src, $this->GetX(), $this->GetY(), 0, 0,'','',false);
//Alinhar imagem ao centro
$this->y = $this->tMargin - $sizesarray['HEIGHT']/8;
$this->x = $this->pgwidth- $sizesarray['WIDTH'];
$sizesarray = $this->Image($src, $this->GetX(), $this->GetY(), 0, 0,'', $mosConfig_live_site );
$this->Ln(1);
//Contruir <HR> particular
$this->SetLineWidth(0.3);
$this->Line($this->x,$this->y,$this->x+$this->pgwidth,$this->y);
$this->SetLineWidth(0.3);
$this->Ln(2);
}
function ProductImg($src,$link) {
$src=str_replace("LightCo_Pty_Ltd_4bc4965436a42.gif", "pdf_logo_2.jpg", $src);
$this->Image($src,5,5,200,40,0,$link);
}
function InitLogo_lightco($src) {
global $mosConfig_live_site;
if ($src == '') return;
// /home/lightco1/public_html/joomla-lightco/components/com_virtuemart/shop_image/vendor/LightCo_Pty_Ltd_4bc4965436a42.gif
if($_SESSION['proj_hdr']){
$proj_hdr = $_SESSION['proj_hdr'];
$_SESSION['proj_hdr'] = '';
$this->Image($src, 2, 2,80,0,0,'http://www.lightco.com.au');
$this->SetTextColor(119,119,119);
$this->SetFont('Arial','B',16);
$this->SetXY(95,5);
$this->Cell(0,0,$proj_hdr['company']);
$this->SetTextColor(159,159,159);
$this->SetFont('Arial','B',13);
$this->SetXY(95,13);
$this->Cell(0,0,'Ph '.$proj_hdr['phone']);
$this->SetXY(95,21);
$this->Cell(0,0,'Fx '.$proj_hdr['fax']);
$this->SetXY(95,29);
$this->Cell(0,0,$proj_hdr['email'],0,0,'L',0,'mailto:'.$proj_hdr['email']);
$this->SetXY(95,37);
$this->Cell(0,0,$proj_hdr['web'],0,0,'L',0,$proj_hdr['web']);
$this->SetXY(95,45);
$this->Cell(0,0,$proj_hdr['addr']);
$this->SetXY(95,53);
$this->Cell(0,0,$proj_hdr['addr2']);
$this->Line(2,65,208,65);
$this->SetTextColor(0);
$this->SetFont('Arial','B',13);
$this->ln(16);
$this->Cell(0,0,$proj_hdr['projname'], 0, 0,'C');
$this->Line(2,73,208,73);
$this->ln(10);
$this->SetFont('Arial','B',11);
$this->Cell(0,0,$proj_hdr['projdescr']);
$this->ln(10);
$this->SetFont('Arial','',11);
}
else{
$src=str_replace("LightCo_Pty_Ltd_4bc4965436a42.gif", "pdf_logo_2.jpg", $src);
$this->Image($src,5,5,200,40,0,'http://www.lightco.com.au');
/* $this->SetTextColor(119,119,119);
$this->SetFont('Helvetica','B',15);
$this->SetXY(110,5);
$this->Cell(0,0,'LightCo Pty Ltd');
$this->SetTextColor(159,159,159);
$this->SetFont('Helvetica','',10);
$this->SetXY(110,13);
$this->Cell(0,0,'Ph 1300 79 55 48');
$this->SetXY(110,18);
$this->Cell(0,0,'Fx 1300 79 55 49');
$this->SetXY(109,23);
$this->Cell(0,0,'INFO@LIGHTCO.COM.AU',0,0,'L',0,'mailto:info@lightco.com.au');
$this->SetXY(109,28);
$this->Cell(0,0,'WWW.LIGHTCO.COM.AU',0,0,'L',0,'http://www.lightco.com.au');
$this->SetXY(110,33);
$this->Cell(0,0,'6/888 Bourke St,');
$this->SetXY(110,38);
$this->Cell(0,0,'Waterloo NSW 2017');
$this->Line(2,65,208,65);
$this->SetTextColor(0);
$this->SetFont('Arial','B',13);
$this->ln(16);
$this->SetXY(10,70);
$this->Cell(0,0,'Product Spec Sheet', 0, 0,'C');
$this->Line(2,73,208,73);
$this->ln(12);*/
}
// $this->Ln(1);
//Contruir <HR> particular
// $this->SetLineWidth(0.3);
// $this->Line($this->x,$this->y,$this->x+$this->pgwidth,$this->y);
// $this->SetLineWidth(0.3);
// $this->Ln(2);
}
//Put title in page
function PutTitle($titulo) {
//! @desc Insert Title on 1st page
//! @return void
$this->SetTitle($titulo);
$this->Ln(10);
$this->SetFont('Arial','B',22);
$this->divalign="L";
$this->divwidth = $this->pgwidth;
$this->divheight = 8.5;
//Custom Word Wrap (para melhorar organiza??o das palvras no titulo)
$maxwidth = $this->divwidth;
$titulo = trim($titulo);
$words = preg_split('/ +/', $titulo);
$space = $this->GetStringWidth(' ');
$titulo = '';
$width = 0;
$numwords = count($words);
for($i = 0 ; $i < $numwords ; $i++)
{
$word = $words[$i];
if ($i + 1 < $numwords) $nextword = $words[$i+1];
else $nextword = '';
$wordwidth = $this->GetStringWidth($word);
$nextwordwidth = $this->GetStringWidth($nextword);
if((strlen($word) <= 3) and ($nextword != '') and ($width + $wordwidth + $nextwordwidth > $maxwidth))
{
//Para n?o ficar um artigo/preposi??o esquecido(a) no final de uma linha
$width = $wordwidth + $space;
$titulo = rtrim($titulo)."\n".$word.' ';
}
elseif ($width + $wordwidth <= $maxwidth) //Palavra cabe, inserir
{
$width += $wordwidth + $space;
$titulo .= $word.' ';
}
else //Palavra n?o cabe, pular linha e inserir na outra linha
{
$width = $wordwidth + $space;
$titulo = rtrim($titulo)."\n".$word.' ';
}
}
$titulo = rtrim($titulo);
//End of Custom WordWrap
$this->textbuffer[] = array($titulo,'','',array());
//Print content
$this->printbuffer($this->textbuffer);
//Reset values
$this->textbuffer=array();
$this->divwidth=0;
$this->divheight=0;
$this->divalign="L";
$this->SetFont('Arial','',11);
$this->Ln(4);
//Contruir <HR> particular
/* $this->SetLineWidth(0.3);
$this->Line($this->x,$this->y,$this->x+$this->pgwidth,$this->y);
$this->SetLineWidth(0.3);
$this->Ln(2);*/
}
//Put author in page
function PutAuthor($autor) {
//! @desc Insert Author on 1st page
//! @return void
$this->SetAuthor($autor);
$this->SetFont('Arial','',14);
$this->SetStyle('B',true);
$this->SetStyle('I',true);
$texto = $autor;//'by author'
$this->MultiCell(0,5,$texto,0,'R');
$this->SetFont('Arial','',11);
$this->SetStyle('B',false);
$this->SetStyle('I',false);
}
//Page footer
function Footer() {
global $mosConfig_live_site, $vendor_name;
//! @desc Insert footer on every page
//! @return void
//Position at 1.0 cm from bottom
/*
$this->SetY(-10);
$this->SetFont('Arial','B',9);
$this->SetTextColor(0);
$texto = "Copyright ".chr(169).date('Y')." - $vendor_name - ";
$this->Cell($this->GetStringWidth($texto),10,$texto,0,0,'L');
$this->SetTextColor(0,0,255);
$this->SetStyle('U',true);
$this->SetStyle('B',false);
$this->Cell(0,10,$mosConfig_live_site,0,0,'L',0,$mosConfig_live_site);
$this->SetStyle('U',false);
$this->SetTextColor(0);
$this->SetFont('Arial','I',9);
$this->Cell(0,10, _PN_PAGE." ".$this->PageNo()." "._PN_OF." {nb}",0,0,'R');
$this->SetFont('Arial','',11);
*/
}
}//end of class
?>