这是我第一次使用 TCPDF,非常好的库,但我不确定如何SetHeaderData
与我的设计保持一致
这是我的代码:
define ('PDF_HEADER_STRING', "No. A-3-2, Kompleks Industri Puchong, No.1 Jalan TPP 1/6, Taman Perindustrian Puchong Seksyen 1, 47100 Puchong, Selangor Darul Ehsan, Malaysia.\nTel: (603) 8068 6119 Fax: (603) 8051 8119 Website: www.projectormalaysia.com\n\nQuotation No: ".$quo_quotationNo." Date: ".$_POST['date']);
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('AV Tech Solution Sdn Bhd');
$pdf->SetTitle('PDF Quotation');
$pdf->SetSubject('PDF Quotation');
$pdf->SetKeywords('');
$pdf->SetHeaderData('avs-logo.png', '30', 'AV Tech Solution Sdn. Bhd. (958788-U)'.' ', PDF_HEADER_STRING);
$pdf->setHeaderFont(Array('times', '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$tagvs = array('p' => array(0 => array('h' => 0.5, 'n' => 0.5), 1 => array('h' => 0.5, 'n' => 0.5)), 'br' => array(0 => array('h' => 1, 'n' => 1), 1 => array('h' => 1, 'n' => 1)));
$pdf->setHtmlVSpace($tagvs);
$pdf->setLanguageArray($l);
$pdf->SetFont('helvetica', '', 8);
$pdf->AddPage();