function Text ($x, $y, $txt) { if ($this->isUnicode) { $txt = mb_convert_encoding ($txt, FPDF_UNICODE_ENCODING, $this->charset); $oEnc = mb_internal_encoding(); mb_internal_encoding (FPDF_UNICODE_ENCODING); $this->UniText ($x, $y, $txt); mb_internal_encoding ($oEnc); } else parent::Text ($x, $y, $txt); }
include_once "api.php"; include_once "fpdf_ch.php"; //print_r($_REQUEST); $strAddress = isset($_POST['address']) ? trim($_REQUEST['address']) : ""; $strComment = isset($_POST['comment']) ? trim($_REQUEST['comment']) : ""; $strDate = isset($_POST['date']) ? trim($_REQUEST['date']) : date("Y m d"); $iExpress = isset($_REQUEST['express']) ? intval($_REQUEST['express']) : 0; $arrInfo = parseAddress($strAddress); $arrPos = array_key_exists($iExpress, $arrPosition) ? $arrPosition[$iExpress] : $arrPosition[0]; $objPDF = new PDF_Chinese("Landscape", "mm", $arrPos['size']->toArray()); $objPDF->AddGBFont(); $objPDF->SetFontSize(11); $objPDF->AddPage(); $objPDF->SetFont("Arial"); $objPDF->Text($arrPos['sendDate']->x, $arrPos['sendDate']->y, parseDate($strDate, $arrPos['dateFormat'])); $objPDF->Text($arrPos['srcPhone']->x, $arrPos['srcPhone']->y, "0571-85790698"); if ($arrPos['srcPCode'] != NULL) { $objPDF->Text($arrPos['srcPCode']->x, $arrPos['srcPCode']->y, "310053"); } $objPDF->Text($arrPos['dstPhone1']->x, $arrPos['dstPhone1']->y, $arrInfo['phone1']); if (isset($arrInfo['phone2'])) { $objPDF->Text($arrPos['dstPhone2']->x, $arrPos['dstPhone2']->y, $arrInfo['phone2']); } if ($arrPos['dstPCode'] != NULL) { $objPDF->Text($arrPos['dstPCode']->x, $arrPos['srcPCode']->y, $arrInfo['postcode']); } $objPDF->SetFont("GB"); $oSize = $objPDF->GetFontSize(); if ($arrPos['srcAddrSize'] != NULL) { $objPDF->SetFontSize($arrPos['srcAddrSize']);