Advertisement
faisholtria

Untitled

Oct 7th, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.94 KB | None | 0 0
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. //require_once(APPPATH.'libraries/pdfwatermarker/pdfwatermarker.php');
  4. //require_once(APPPATH.'libraries/pdfwatermarker/pdfwatermark.php');
  5. //require_once(APPPATH.'libraries/fpdf/fpdi.php');
  6. require_once(APPPATH.'libraries/fpdf/rotation.php');
  7.  
  8. class Product extends CI_Controller {
  9.     public function __construct()
  10.         {
  11.             parent::__construct();
  12.             // $this->load->model("M_products");
  13.             // $this->load->model("M_packages");
  14.             // $this->load->model("M_features");
  15.  
  16.             // $this->load->model("product/Item_catalogue_model", "items");
  17.             // $this->load->model("product/Owner_model", "owner");
  18.             // $this->load->model("product/Products_model", "product");
  19.             // $this->load->model("product/Product_items_model", "product_items");
  20.             // $this->load->model("product/Bill_cycle_model", "bill_cycle");
  21.                
  22.         }
  23.  
  24.     public function dummy(){
  25.        
  26.     $pdf=new PDF();
  27.     $pdf->AddPage();
  28.     $pdf->SetFont('Arial', '', 12);
  29.     $txt="FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say ".
  30.         "without using the PDFlib library. F from FPDF stands for Free: you may use it for any ".
  31.         "kind of usage and modify it to suit your needs.\n\n";
  32.     for($i=0;$i<25;$i++)
  33.         $pdf->MultiCell(0, 5, $txt, 0, 'J');
  34.     $pdf->Output();        
  35.         }
  36.    
  37. }
  38. class PDF extends PDF_Rotate
  39. {
  40.     function Header()
  41.     {
  42.         //Put the watermarkoooooooooooooooooooo
  43.         $this->SetFont('Arial', 'B', 50);
  44.         $this->SetTextColor(255, 192, 203);
  45.         $this->RotatedText(35, 190, 'Faishol Tri A', 45);
  46.     }
  47.  
  48.     function RotatedText($x, $y, $txt, $angle)
  49.     {
  50.         //Text rotated around its origin
  51.         $this->Rotate($angle, $x, $y);
  52.         $this->Text($x, $y, $txt);
  53.         $this->Rotate(0);
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement