diff --git a/models/app_model.php b/models/app_model.php new file mode 100644 index 00000000..120aa563 --- /dev/null +++ b/models/app_model.php @@ -0,0 +1,40 @@ + \ No newline at end of file diff --git a/vendors/xtcpdf.php b/vendors/xtcpdf.php index a6575e3b..d65b2d43 100644 --- a/vendors/xtcpdf.php +++ b/vendors/xtcpdf.php @@ -11,6 +11,7 @@ class XTCPDF extends TCPDF var $xfooterfontsize = 8 ; + /** * Overwrites the default header * set the text in the view using @@ -20,7 +21,7 @@ class XTCPDF extends TCPDF * set the font in the view using * $fpdf->setHeaderFont(array('YourFont','',fontsize)); */ - function Header() + function Page1Header() { @@ -32,12 +33,15 @@ class XTCPDF extends TCPDF $this->SetFillColor(255, 255, 255); $this->SetTextColor(0 , 0, 152); //Set the Text Color to Blue - $this->Image(K_PATH_IMAGES.'cmclogosmall.jpg', 2, 0, 30, 0, null, 'http://www.cmctechnologies.com.au', null, false, null, 'L'); + // $this->Image($file, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $ismask, $imgmask, $border, $fitbox, $hidden) + + $this->Image(K_PATH_IMAGES.'cmclogosmall.jpg', 10, 10, 30, 0, null, 'http://www.cmctechnologies.com.au', null, false, null, 'L'); $this->Cell(30); $this->SetFont('times', 'B'); + $this->SetFontSize(30); $this->Cell(0,0, $this->xheadertext, 0,1,'C', 1); $this->SetFontSize(10); - $this->SetY(14); + $this->SetY(22); $this->Cell(30); $this->Cell(0,0, "PTY LIMITED ACN: 47 085 991 224 ABN: 47 085 991 224", 0, 1, 'C', 1); @@ -88,7 +92,7 @@ class XTCPDF extends TCPDF $this->SetTextColor(0); //Black Text $boxYstart = 45; - $boxXstart = 5; + $boxXstart = 10; $firstColWidth = 40; $secondColWidth = 80; $thirdColWidth = 30; @@ -108,12 +112,16 @@ class XTCPDF extends TCPDF $this->SetXY($boxXstart, 45); + + // $this->MultiCell($w, $h, $txt, $border, $align, $fill, $ln, $x, $y, $reseth, $stretch, $ishtml); $this->Cell($firstColWidth, 0, "QUOTATION TO:", 'LTRB', 0, 'L', 0, null, 0, false); $this->Cell($secondColWidth, 0, $companyName, 'LTRB', 0, 'L', 0, null, 0, false); $this->Cell($thirdColWidth, 0, "FROM:", 'LTB', 0, 'L', 0, null, 0, false); $this->Cell($fourthColWidth, 0, $fromName, 'TBR', 1, 'L', 0, null, 0, false); //Start a new line after this. + + $this->SetX($boxXstart); $this->Cell($firstColWidth, 0, "EMAIL TO:", 'LTRB', 0, 'L', 0, null, 0, false); diff --git a/views/quotes/pdf.ctp b/views/quotes/pdf.ctp index 26a4c758..24c6a681 100644 --- a/views/quotes/pdf.ctp +++ b/views/quotes/pdf.ctp @@ -9,7 +9,10 @@ $tcpdf = new XTCPDF(); $textfont = 'times'; // looks better, finer, and more condensed than 'dejavusans' -$tcpdf->SetTopMargin(0); +//$tcpdf->SetTopMargin(); +//$tcpdf->SetLeftMargin(29); +//$tcpdf->SetMargins(1, 1); + $tcpdf->SetAuthor("CMC Technologies"); $tcpdf->SetTitle("CMC Technologies Quote"); @@ -19,7 +22,11 @@ $tcpdf->xheadercolor = array(150,0,0); $tcpdf->xheadertext = 'CMC TECHNOLOGIES'; $tcpdf->xfootertext = 'Copyright © %d CMC Technologies. All rights reserved.'; -//$tcpdf->Header(); +$tcpdf->setPrintHeader(false); +$tcpdf->setPrintFooter(false); + + + // // Now you position and print your page content @@ -30,7 +37,7 @@ $tcpdf->Cell(0,14, "Hello World", 0,1,'L'); */ $tcpdf->AddPage(); - +$tcpdf->Page1Header(); $tcpdf->DetailsBox(); $content = <<lastPage(); $tcpdf->Output('/home/karl/public_html/cake/quotenik-working/webroot/pdf/filename2.pdf', 'F'); //$tcpdf->Output('cmcquote.pdf', 'D'); + + + + ?> \ No newline at end of file