<?php
/**********************************************************************
    Copyright (C) FrontAccounting, LLC.
	Released under the terms of the GNU General Public License, GPL, 
	as published by the Free Software Foundation, either version 3 
	of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/

/**
	Document blueprint use following parameters set in doctext.inc:

	$Addr1,	$Addr2 - address info
	$Payment_Terms - payment terms line
	$Footer - footer texts
	$this->company - company info
	$this->title - report title
	$this->formData - some other info
***/

		$this->row = $this->pageHeight - $this->topMargin;

		$upper = $this->row - 2 * $this->lineHeight;
		$lower = $this->bottomMargin + 8 * $this->lineHeight;
		$iline1 = $upper - 15 * $this->lineHeight;
		$iline2 = $iline1 - 4 * $this->lineHeight;
		$iline3 = $iline2 - 1.5 * $this->lineHeight;
		$iline4 = $iline3 - 1.5 * $this->lineHeight;
		$iline5 = $iline4 - 3 * $this->lineHeight;
		$iline6 = $iline5 - 1.5 * $this->lineHeight;
		$iline7 = $lower;
		$right = $this->pageWidth - $this->rightMargin;
		$width = ($right - $this->leftMargin) / 4;
		$icol = $this->pageWidth / 2;
		$ccol = $this->cols[0] + 4;
		$c2col = $ccol + 60;
		$ccol2 = $icol / 2;
		$mcol = $icol + 8;
		$mcol2 = $this->pageWidth - $ccol2;
		$cols = count($this->cols);
		// $this->SetDrawColor(205, 205, 205);
		// $this->Line($iline1, 1);
		// $this->SetDrawColor(128, 128, 128);
		// $this->Line($iline1);
		// $this->rectangle($this->leftMargin, $iline2, $right - $this->leftMargin, $iline2 - $iline3, "F", null, array(222, 231, 236));   
		// $this->Line2($iline1);

		// $this->Line($iline2+10);
		// $this->NewLine();
		// $this->Line($iline3);
		// $this->Line2($iline4-10);

		// $this->SetLineStyle(array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(128, 128, 128)));
		// $this->RoundedRect(190,130, 220, 30, 0, '1111', 'D',null, array(128, 128, 128));

		// $this->fontSize += 8;
		// $this->Font('B','Book-antiqua-bold-font');
		// $this->TextWrap(200,642,500, _("PROFORMA INVOICE"));
		// $this->fontSize -= 8;
		// $this->Font();


		$this->SetLineStyle(array('width' => 1.2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
		$this->RoundedRect(8, 90, 595, 650, 0, '1111', 'D',null, array(0, 0, 0));

// // display_error($this->formData['DebtorName']);
// 		// $this->fontSize += 2;
// 		// $this->TextWrap(100,602,500, $this->formData['DebtorName']);
// 		$old_row=$this->row;
// 		$this->row=602;
// 		$this->Font('B');
// 		$this->TextWrap(40,$this->row,500, _("Consignee :"));
// 		$this->Font();
// 		$this->NewLine();
// 		$this->SetTextColor(125, 125, 125);
// 		$this->TextWrapLines(50,300, $this->formData['delivery_address']);
// 				$this->SetTextColor(0, 0,0);
		

//         $this->row=530;
// 		$this->Font('B');
// 		$this->TextWrap(40,$this->row,500, _("Account & Bank Details:"));
// 		$this->Font();
// 		$this->fontSize -= 2;
// 		// $this->fontSize -= 2;

// 		// $this->fontSize += 2;
// 	    $this->NewLine();
// 		$this->SetTextColor(125, 125, 125);
		
// 		$this->TextWrap(50,$this->row,500, _("RICE ENTERPRISE "));
// 		$this->NewLine();
// 		$this->TextWrap(50,$this->row,500, _("Bank Alfalh "));
// 		$this->NewLine();
// 		$this->TextWrap(50,$this->row,500, _("Site Area Branch,Karachi pakistan"));
// 		$this->NewLine();
// 		$this->TextWrap(50,$this->row,500, _("SWIFT CODE : ALFHPKKA"));
// 		$this->NewLine();
// 		$this->TextWrap(50,$this->row,500, _("ACCOUNT NO. 0019001008530453"));
// 			    $this->NewLine();
// 		$this->TextWrap(50,$this->row,500, _("IBAN No. PK88ALFH0019001008530453"));
// 				$this->SetTextColor(0, 0,0);

// 		// // display_error($this->row);
// 		// $this->TextWrapLines(100,270, $this->formData['address']);
//         // // display_error("<br>  ".$this->row);
//         // // exit();
// 		// // $this->TextWrap(100,571,500, $this->formData['ntn_no']);
//         // // $this->row+=6;   
// 		// $this->fontSize += 2;
// 		// $this->Font('B');
// 		// $this->TextWrap(40,$this->row,500, _("N.T.N.  :   "));
// 		// $this->Font();
// 		// $this->fontSize -= 2;
// 		// $this->TextWrapLines(100,500, $this->formData['ntn_no']);
        
// 		// // $this->TextWrap(100,555,500, $this->formData['tax_id']);
// 		// $this->fontSize += 2;
// 		// $this->Font('B');
// 		// $this->TextWrap(40,$this->row,500, _("S.T.R.N  :   "));
// 		// $this->Font();
// 		// $this->fontSize -= 2;
// 		// $this->TextWrapLines(100,500, $this->formData['tax_id']);

// 		$this->row=$old_row;

// 		$this->SetLineStyle(array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(128, 128, 128)));
// 		$this->RoundedRect(375, 173, 210, 170, 0, '1111', 'D',null, array(128, 128, 128));


// 		$this->fontSize += 2;
// 		$this->Font('B');
// 				$this->SetTextColor(125, 125, 125);
// 		$this->TextWrap(515,602,500, $this->formData['export_inv_ref']);
// 				$this->SetTextColor(0, 0, 0);
// 		$this->TextWrap(385,602,500, _("Invoice Number  :   "));
// 		$this->fontSize -= 2;
// 		$this->Font();
// 		$this->Font('BU');
// 		$this->TextWrap(375,595,300, _("____________________________________________________"));
// 		$this->Font();
// 						$this->SetTextColor(125, 125, 125);
// 		$this->TextWrap(540,580,500, sql2date($this->formData['ord_date']));
// 						$this->SetTextColor(0, 0, 0);
		// $this->fontSize += 2;
		// $this->Font('B');
		// $this->TextWrap(385,580,500, _("Date  :   "));
		// $this->fontSize -= 2;
		// $this->Font();
       
       	// 			$this->SetTextColor(125, 125, 125);
		// $this->TextWrap(77,560,500, $this->formData['buyer_order_no'],'right');
		// 				$this->SetTextColor(0, 0, 0);
		// $this->fontSize += 2;
		// $this->Font('B');
		// $this->TextWrap(385,560,500, _("Buyer's Order No  :   "));
		// $this->fontSize -= 2;
		// $this->Font();

		// 		$this->SetTextColor(125, 125, 125);
		// 		$this->TextWrap(77,540,500, $this->formData['term_of_del'],'right');
		// 						$this->SetTextColor(0, 0, 0);
		// $this->fontSize += 2;
		// $this->Font('B');
		// $this->TextWrap(385,540,500, _("Term Of Delivery  :   "));
		// $this->fontSize -= 2;
		// $this->Font();

        //       				$this->SetTextColor(125, 125, 125);
		// 		$this->TextWrap(77,520,500, $this->formData['finel_destination'],'right');
		// 						$this->SetTextColor(0, 0, 0);
		// $this->fontSize += 2;
		// $this->Font('B');
		// $this->TextWrap(385,520,500, _("Finel Destination  :   "));
		// $this->fontSize -= 2;
		// $this->Font();
                

        //       				$this->SetTextColor(125, 125, 125);
		// 		$this->TextWrap(77,500,500, get_shipper($this->formData['ship_via'])['shipper_name'],'right');
		// 						$this->SetTextColor(0, 0, 0);
		// $this->fontSize += 2;
		// $this->Font('B');
		// $this->TextWrap(385,500,500, _("Shipping By  :   "));
		// $this->fontSize -= 2;
		// $this->Font();

		// $row = get_payment_terms($this->formData['payment_terms']);
        //  // print_r($row);exit();

		// $this->SetTextColor(125, 125, 125);
		// if($row['terms_indicator']==5)
        // $this->TextWrap(77,480,500, $this->formData['pay_perc']."% ".$row['terms'],'right');
		// else
		// $this->TextWrap(77,480,500, $row['terms'],'right');
		// $this->SetTextColor(0, 0, 0);

		// $this->fontSize += 2;
		// $this->Font('B');
		// $this->TextWrap(385,480,500, _("Payment term  :   "));
		// $this->fontSize -= 2;
		// $this->Font();

		// $this->rectangle($this->leftMargin, $iline5, $right - $this->leftMargin, $iline5 - $iline6+30, "F", null, array(211, 211, 211));   
		// $this->Line($iline5);
		// $this->Line($iline6-13);
		// $this->Line($iline7);
		// $this->Line($iline7+20);
		// $this->LineTo($this->leftMargin, $iline1 ,$this->leftMargin, $iline4-10);
		// $col = $this->leftMargin;
		// for ($i = 0; $i < 5; $i++)
		// {
		// 	if($i%2==0)
		// 	$this->LineTo($col += $width, $iline1,$col, $iline4-10);
		// 	else  
		// 	$this->LineTo($col += $width, $iline1,$col, $iline4-10);
		// }

		// $this->LineTo(($col += $width)-30 , $iline1,$col-30 , $iline4-10);
		// $this->LineTo($col += $width, $iline1,$col, $iline4-10);
		// $this->LineTo( ($col += $width)-40, $iline1,$col-40, $iline4-10);
		// $this->LineTo($col += $width+216, $iline1,$col, $iline4-10);

		// $this->LineTo($this->leftMargin, $iline5 ,$this->leftMargin, $iline7);



		// $this->LineTo($this->leftMargin, $iline1 ,$this->leftMargin, $iline4-10);
		// $col = $this->leftMargin;

		// if ($this->l['a_meta_dir'] == 'rtl') // avoid line overwrite in rtl language
		// 	$this->LineTo($this->cols[$cols - 2], $iline5 ,$this->cols[$cols - 2], $iline7);
		// else	
		// 	$this->LineTo($this->cols[$cols - 2] + 4, $iline5 ,$this->cols[$cols - 2] + 4, $iline7);

        //   for ($i=0; $i < count($this->cols)-1 ; $i++)  if($i>0)
		// 	$this->LineTo($this->cols[$i]-5 , $iline5 ,$this->cols[$i]-5, $iline7);


		// $this->LineTo($right, $iline5 ,$right, $iline7);


		// $this->NewLine(1.5);
		// $adrline = $this->row;
        // Company Logo
		$save_line = $this->row;
		$logo = company_path() . "/images/" . $this->company['coy_logo'];
		// if ($this->company['coy_logo'] != '' && file_exists($logo))
		// {
		// 	// $this->AddImage($logo, $ccol-23, $this->row+40, 0, 60);
		// }
	
		$this->NewLine(4.5);
		// display_error($save_line);
		// $this->NewLine();
		$this->fontSize +=18;
		$this->Font('bold','times');
		$company_id = get_latter_hand_setting($this->formData['company_id']);
		// $this->Text($ccol+110, $this->company['coy_name'], $icol+300, 0, -50);
		if (@$this->company['coy_name']  || $company_id['latter_head_id']) {
			if($company_id['latter_head_id'])
			$coy_name  = get_latter_hand_name($company_id['latter_head_id']);
			else
			$coy_name = $this->company['coy_name'];
			$this->Text($ccol-20, $coy_name, $icol+300, 0, -50, 'center');
		}
		$this->Font('','helvetica');
		$this->fontSize -= 18;
		$this->row = $save_line;
		// display_error(br() . '=='.  $save_line .' =='. $this->row);
		// exit();
		// $this->TextWrap(140, 740, 800, $this->company['postal_address']);
		if (@$this->company['postal_address']  || $company_id['address'])
		{	
			if($company_id['address'])
			$address  = $company_id['address'];
			else
			$address = $this->company['postal_address'];
			$this->TextWrap(140, 740, 800, $address);
			// $this->TextWrapLines($ccol, $icol, $address);
		}
		$this->fontSize +=4;
		$this->Font('bold','times');
		$this->TextWrap(270, 720, 800, _("Packing List"));
		$this->Font('','helvetica');
		$this->fontSize -= 4;
   		// $this->TextWrapLines($mcol-100, $icol, $this->company['postal_address']);
		// $this->SetDrawColor(0, 0, 0);
		// $this->Line($iline1+150, 3);
		// $this->SetDrawColor(0, 0, 0);
		// $this->SetLineStyle(array('width' => 3, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
		// $this->RoundedRect(8, 83, 595, 0, 0, '1111', 'D',null, array(0, 0, 0));

		// Document title
  		// $this->row = $adrline;
			
		// $this->SetTextColor(100, 100, 100);
		// $this->fontSize += 10;
		// $this->Font('bold');
		// $this->TextWrap($mcol, $this->row, $this->pageWidth - $this->rightMargin - $mcol - 20, $this->title, 'right');
		// $this->Font();
		// $this->fontSize -= 10;
		// $this->SetTextColor(0, 0, 0);
           
      // $this->NewLine(2); 

		// $this->SetTextColor(190, 190, 190);
		// $this->Font();
		// $this->TextWrap($mcol+120, $this->row, 90, '   Orignal | Duplicate ', 'left',0);
		// $this->Font();

		// $this->SetTextColor(0, 0, 0);


      //     $this->NewLine(5.5); 
		// 	$this->Font('italic');
		// $this->fontSize += 2;

		// $this->TextWrap($ccol, $this->row, $right-$ccol, "NO. ___________");
		// $this->fontSize -= 2;

		// $this->TextWrap($ccol+30, $this->row, $right-$ccol,  $this->formData['document_number']);

      //   $this->fontSize += 2;
		// $this->TextWrap($ccol+220, $this->row, $right-$ccol, "Date. ___________");
		// $this->fontSize -= 2;
		// $this->TextWrap($ccol+255, $this->row, $right-$ccol,   sql2date($this->formData['document_date']));		


		// $this->fontSize += 2;
		// $this->TextWrap($mcol+120, $this->row, $right-$mcol, "Time of Supply. ___________");
		// $this->fontSize -= 2;
		// $this->TextWrap($mcol+240, $this->row, $right-$mcol,   "");		

        // $head_text="Manufacturing For All Kind Of Textile Polyethylene \n Bags and Packing Material Supplier";
   		// $this->TextWrapLines($mcol, $icol, $this->company['postal_address']);
        // $this->NewLine(); 
		// Company data
		// $this->TextWrapLines($ccol, $icol, $this->company['postal_address']);
		// $this->Font('italic');
		// if (@$this->company['phone'])
		// {
		// 	$this->Text($ccol, _("Phone"), $c2col);
		// 	$this->Text($c2col, $this->company['phone'], $mcol);
		// 	$this->NewLine();
		// }
		// if (@$this->company['fax'])
		// {
		// 	$this->Text($ccol, _("Fax"), $c2col);
		// 	$this->Text($c2col, $this->company['fax'], $mcol);
		// 	$this->NewLine();
		// }
		// if (@$this->company['email'])
		// {
		// 	$this->Text($ccol, _("Email"), $c2col);

		// 	$url = "mailto:" . $this->company['email'];
		// 	$this->SetTextColor(0, 0, 255);
		// 	$this->Text($c2col, $this->company['email'], $mcol);
		// 	$this->SetTextColor(0, 0, 0);
		// 	$this->addLink($url, $c2col, $this->row, $mcol, $this->row + $this->lineHeight);

		// 	$this->NewLine();
		// }
		// if (@$this->company['gst_no'])
		// {
		// 	$this->Text($ccol, _("N.T.N #:"), $c2col);
		// 	$this->Text($c2col, $this->company['gst_no'], $mcol);
		// 	$this->NewLine();
		// }
		// if (@$this->formData['domicile'])
		// {
		// 	$this->Text($ccol, _("Domicile"), $c2col);
		// 	$this->Text($c2col, $this->company['domicile'], $mcol);
		// 	$this->NewLine();
		// }
		$this->Font();
		
		// $this->NewLine(3);
		// $this->Text($mcol + 100, _("Date"));
		// $this->Text($mcol + 180, sql2date($this->formData['document_date']));

		// $this->NewLine();
		// $this->Text($mcol + 100, $this->formData['document_name']);
		// $this->Text($mcol + 180, $this->formData['document_number']);
		// $this->NewLine(2);
	
		if ($this->pageNumber > 1){
			$this->NewLine(1.5);
			$this->Font('BU');
			$this->Text($mcol-40, _("PAGE #") . ' ' . $this->pageNumber);
			$this->Font();
		}
		// $this->row = $iline1 - $this->lineHeight;
		// $this->fontSize -= 4;
		// $this->Text($ccol, $Addr1['title'], $icol);
		// $this->Text($mcol, $Addr2['title']);
		// $this->fontSize += 4;
        		// $this->SetTextColor(0, 0, 0);


  //     		$this->NewLine();
  //     $this->SetTextColor(190, 190, 190);
		// $this->fontSize += 10;
		// $this->Font('bold');
		// $this->TextWrap($ccol+90, $this->row, $this->pageWidth - $this->rightMargin - $mcol - 20, $this->title, 'right');
		// $this->Font();
		// $this->fontSize -= 10;
		// 		$this->SetTextColor(0, 0, 0);



// // address1
// 		$temp = $this->row = $this->row - $this->lineHeight - 5;
// 		$this->Text($ccol, $Addr1['name'], $icol);
// 		$this->NewLine();
// 		$this->TextWrapLines($ccol, $icol - $ccol, $Addr1['address']);

// // address2
// 		$this->row = $temp;
// 		$this->Text($mcol, $Addr2['name']);
// 		$this->NewLine();
// 		$this->TextWrapLines($mcol, $this->rightMargin - $mcol, $Addr2['address'], 'left', 0, 0, NULL, 1);

		// Auxiliary document information
		// $col = $this->leftMargin;
		// foreach($aux_info as $info_header => $info_content)
		// {

		// 	$this->row = $iline2 - $this->lineHeight - 1;
		// 	$this->TextWrap($col, $this->row, $width, $info_header, 'C');
		// 	$this->row = $iline3 - $this->lineHeight - 1;
		// 	$this->TextWrap($col, $this->row, $width, $info_content, 'C');
		// 	$col += $width;
		// }
		// Payment terms
		// // $this->row -= (1 * $this->lineHeight);
		// // $temp = $this->row ;
		// // $this->Font('italic');
		// // $this->fontSize += 4;

		// // $this->TextWrapLines($ccol+20, 70, "Supplier's Name & Address ");
		// // $this->fontSize -= 4;
      
      // // $this->row = $temp;
		// // $this->Font('bold');

		// // $this->fontSize += 6;
		// // $this->TextWrapLines($ccol+120, 120, $this->company['coy_name']);
		// // $this->fontSize -= 6;
      // // 		$this->Font();


		// $this->fontSize += 12;
		// $this->Font('B');
		// $this->TextWrap(220,710,500, "RICE ENTERPRISE" ); //$this->company['coy_name']
		// $this->fontSize -= 12;
		// $this->Font();

		// $this->fontSize += 1;
		// $this->Font('B');
		// $this->TextWrap(60,697,500, $this->company['postal_address'],'center');
		// $this->fontSize -= 1;
		// $this->Font();

		// $this->fontSize += 2;
		// $this->Font('B');
		// $this->TextWrap(150,686,500, _("Contact : ". $this->company['coy_no'].", ". $this->company['bcc_email'] ));
		// $this->TextWrap(225,673,500, _("NTN  ". $this->company['domicile']) ." - ". "STRN  " . $this->company['gst_no']);
		// $this->Font();
		// $this->fontSize -= 2;
		// $this->fontSize += 1;
		// $this->TextWrapLines($ccol+120, 100, 'D26/A South Avenue Manghopir Mauripur Road ,S.I.T.E, Karachi');
		// $this->fontSize -= 1;

      // //   $this->row = $temp;
      // // 			$this->Font('italic');
		// // $this->fontSize += 4;

		// // $this->TextWrapLines($ccol+290, 70, "Buyer's Name & Address ");
		// // $this->fontSize -= 4;
      // //   $this->row = $temp;

      // //   $this->fontSize += 1;
      // //         		$this->Font('bold');
		// // $this->TextWrapLines($ccol+380, 150, $Addr1['name']);
		// // $this->fontSize -= 1;
      // // 		$this->Font();

		// // $this->fontSize += 1;
      // //   // $arr=explode('\n', $this->company['postal_address']);
		// // $this->TextWrapLines($ccol+380, 150, $Addr1['address']);
		// // $this->fontSize -= 1;



      // //   // $this->NewLine(4);
      // //   		$this->row = $iline2 - $this->lineHeight - 1;


      // //   		$temp = $this->row ;
      // //   $this->Font('italic');
		// // $this->fontSize += 2;

		// // $this->TextWrapLines($ccol+20, 70, "N. T. No. ");
		// // $this->fontSize -= 2;
		// //         $this->row = $temp;

		// //         $this->fontSize += 2;
		// // $this->TextWrapLines($ccol+155, 120,$this->company['domicile'] );
		// // $this->fontSize -= 2;

      // //    $this->row = $temp;


		// // $this->Font('italic');
		// // $this->fontSize += 2;

		// // $this->TextWrapLines($ccol+290, 70, "N. T. No. ");
		// // $this->fontSize -= 2;
		// // $this->row = $temp;

		// $this->fontSize += 2;
		// $this->TextWrapLines( $ccol+420, 120, $this->formData['ntn_id'] );
		// $this->fontSize -= 2;





		// $this->NewLine(1);
		// $temp = $this->row ;
		// $this->Font('italic');
		// $this->fontSize += 2;

		// // $this->TextWrapLines($ccol+20, 80, "ST. Reg No. ");
		// $this->fontSize -= 2;
		//         $this->row = $temp;

		//         $this->fontSize += 2;
		// $this->TextWrapLines($ccol+155, 120,$this->company['gst_no'] );
		// $this->fontSize -= 2;

      //    $this->row = $temp;


		// $this->Font('italic');
		// $this->fontSize += 2;

		// $this->TextWrapLines($ccol+290, 80, "ST. Reg No. ");
		// $this->fontSize -= 2;
		//         $this->row = $temp;

		//         $this->fontSize += 2;
		// $this->TextWrapLines($ccol+420, 120, $this->formData['tax_id'] );
		// $this->fontSize -= 2;

			// $this->row -= (2 * $this->lineHeight);
		// $this->NewLine();
		// $this->Font('italic');
		// $this->TextWrap($ccol, $this->row, $right-$ccol, $Payment_Terms);
		// $this->Font();


		// $this->TextWrap($ccol+30, $this->row, $right-$ccol,  $this->formData['document_number']);
  //       $this->fontSize += 2;
		// $this->TextWrap($mcol+180, $this->row, $right-$mcol, "Date. ___________");
		// $this->fontSize -= 2;
		// $this->TextWrap($mcol+215, $this->row, $right-$mcol,   sql2date($this->formData['document_date']));		

		// $this->NewLine(2);
		// $this->fontSize += 2;
		// $this->TextWrap($ccol, $this->row, $right-$ccol, "Messers. ___________________________________________");
		// $this->fontSize -= 2;
		// $this->TextWrap($ccol+50, $this->row, $right-$ccol,  "  ".$Addr1['name']);	

		// $this->NewLine(1.5);
	 //    $this->fontSize += 2;
		// $this->TextWrap($ccol, $this->row, $right-$ccol, "               ___________________________________________");
		// $this->fontSize -= 2;
		// $this->TextWrap($ccol+50, $this->row, $right-$ccol,    "  ".$Addr1['address']);				

		// $this->Font();

		// Line headers
		// $this->row = 350;
		// $this->Font('bold');
		// $count = count($this->headers);
		// $this->cols[$count] = $right - 3;
		// $this->aligns[2] = $this->aligns[3] = $this->aligns[4] = $this->aligns[5] = $this->aligns[6]
		// 	= $this->aligns[7] = 'center';
		// for ($i = 0; $i < $count; $i++){
		// 	$oldrow = $this->row;
		// 	$this->TextColLines($i, $i + 1, $this->headers[$i], -2);
		// 	$newrow = $this->row;
		// 	$this->row = $oldrow;
		// }
		// $this->aligns[2] = 'left';
		// $this->aligns[3] = $this->aligns[4] = $this->aligns[5] = $this->aligns[6]
		// 	= $this->aligns[7] = 'right';
		// $this->Font();

		// Footer
		// $this->Font('italic');
		// $this->row = $iline7 - $this->lineHeight - 6;

		// foreach ($Footer as $line => $txt)
		// {
		// 	if (!is_numeric($line))	// title => link
		// 	{
		// 		$this->fontSize -= 2;
		// 		$this->TextWrap($ccol, $this->row, $right - $ccol, $line, 'C');
		// 		$this->row -= $this->lineHeight;
		// 		$this->SetTextColor(0, 0, 255);
		// 		$this->TextWrap($ccol, $this->row, $right - $ccol, $txt, 'C');
		// 		$this->SetTextColor(0, 0, 0);
		// 		$this->addLink($txt, $ccol, $this->row, $this->pageWidth - $this->rightMargin, $this->row + $this->lineHeight);
		// 		$this->fontSize += 2;
		// 	}
		// 	else
		// 		$this->TextWrap($ccol, $this->row, $right - $ccol, $txt, 'C');
		// 	$this->row -= $this->lineHeight;

		// }

		// $this->SetTextColor(255, 0, 0);
		// $this->TextWrap($ccol, 800 ,300, '( This Document System Generated No Need to signature and stemp )', 'L');
		// $this->SetTextColor(0, 0, 0);

		// $this->Font();
		// $temp = $iline6 - $this->lineHeight-15;
