westdc-zf1/application/models/ApplicantPDF.php

45 lines
1.5 KiB
PHP

<?php
//生成西部数据中心离线申请表
require_once('fpdf/chinese-unicode.php');
class ApplicantPDF extends FPDI
{
require_once('fpdi/fpdi.php');
public $template;//模板文件的路径
public $data;//包含具体的数据,数组
public $fontsize=10;
function drawWestdc()
{
$pagecount = $this->setSourceFile($this->template);
$tplidx = $this->importPage(1, '/MediaBox');
$this->addPage();
$this->useTemplate($tplidx);
$this->AddUniGBhwFont('ugb','AdobeSongStd-Light-Acro');
$this->SetFont('ugb','',$this->fontsize);
$this->setXY(45,77);
$this->Write($this->fontsize,$this->data['realname']);
$this->SetXY(34,87);
$this->MultiCell (0, 4, str_replace(";","\n",$this->data['datalist']));
$this->setXY(34,130);
$this->Write($this->fontsize,trim($this->data['project']));
$this->setXY(34,251);
$this->Write($this->fontsize,$this->data['realname']);
$this->setXY(34,258);
$this->Write($this->fontsize,$this->data['unit']);
$this->setXY(100,258);
$this->Write($this->fontsize,$this->data['address']);
$this->setXY(164,258);
$this->Write($this->fontsize,$this->data['postcode']);
$this->setXY(34,264);
$this->Write($this->fontsize,$this->data['email']);
$this->setXY(100,264);
$this->Write($this->fontsize,$this->data['phone']);
$t=getdate();
$this->setXY(159,264);
$this->Write($this->fontsize,$t['year']);
$this->setXY(171,264);
$this->Write($this->fontsize,$t['mon']);
$this->setXY(180,264);
$this->Write($this->fontsize,$t['mday']);
}
}
?>