本文整理汇总了PHP中Zend_Pdf_Page::drawImage方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Pdf_Page::drawImage方法的具体用法?PHP Zend_Pdf_Page::drawImage怎么用?PHP Zend_Pdf_Page::drawImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Pdf_Page
的用法示例。
在下文中一共展示了Zend_Pdf_Page::drawImage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createHeader
protected function createHeader(\Zend_Pdf_Page $page)
{
$filename = APPLICATION_PATH . "/../public/images/invoice-logo.png";
$image = new \Zend_Pdf_Resource_Image_Png($filename);
$page->drawImage($image, 30, 533, 210, 560);
$this->createSeller($page);
}
示例2: drawDatamatrix
protected function drawDatamatrix($object)
{
$matrixItem = $object->getItem();
$x = 214 / 2;
// barcode center
$y = 214 / 2;
// barcode center
$height = 40;
// barcode height in 1D ; module size in 2D
$width = 40;
// barcode height in 1D ; not use in 2D
// datamatrix creator expects iso 8859-1 code
$code = str_replace("?", "|", $this->utf8ToIso88591($object->getValue()));
$type = 'datamatrix';
$im = imagecreatetruecolor(214, 214);
$black = ImageColorAllocate($im, 0x0, 0x0, 0x0);
$white = ImageColorAllocate($im, 0xff, 0xff, 0xff);
imagefilledrectangle($im, 0, 0, 214, 214, $white);
$data = $matrixItem::gd($im, $black, $x, $y, 0, $type, array('code' => $code));
ob_start();
imagepng($im);
$imagestring = ob_get_contents();
ob_end_clean();
imagedestroy($im);
$temp = tempnam(sys_get_temp_dir(), 'DMX');
//tmpfile();
$handle = fopen($temp, 'w+b');
fwrite($handle, $imagestring);
fseek($handle, 0);
$image = new Zend_Pdf_Resource_Image_Png($temp);
fclose($handle);
//statt drawImage($image, $x1, $y1, $x2, $y2) nun drawImage($image, $x1, $y2, $x2, $y1)
$this->page->drawImage($image, $this->coordX($this->mmToPts($object->getPosx())), $this->coordY($this->mmToPts($object->getPosy() + $matrixItem->getDimension())), $this->coordX($this->mmToPts($object->getPosx() + $matrixItem->getDimension())), $this->coordY($this->mmToPts($object->getPosy())));
}
示例3: addNext
public function addNext($giftCard)
{
$template = $giftCard->getTemplate();
if (!$template) {
return false;
}
$page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
$draw = Mage::getModel('giftcard/giftcard_draw');
$draw->setGiftCard($giftCard);
$draw->setTemplate($template);
$draw->drawGiftCard();
if (!($imagePath = $draw->getImagePath())) {
return false;
}
$image = Zend_Pdf_Image::imageWithPath($imagePath);
$imgWidthPts = $image->getPixelWidth() * 72 / 96;
$imgHeightPts = $image->getPixelHeight() * 72 / 96;
$rate = $imgWidthPts / $page->getWidth();
$imgWidthPts = $imgWidthPts / $rate;
$imgHeightPts = $imgHeightPts / $rate;
$pageHeight = $page->getHeight();
$page->drawImage($image, 0, $pageHeight - $imgHeightPts, $imgWidthPts, $pageHeight);
$this->addPage($page);
unlink($imagePath);
return true;
}
示例4: addPieceIdBarcode
/**
* Add Piece Id Barcode
*
* @param string $dataIdentifier
* @param string $licensePlate
* @param string $barCode
* @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder
* @throws InvalidArgumentException
* @throws Zend_Pdf_Exception
*/
public function addPieceIdBarcode($dataIdentifier, $licensePlate, $barCode)
{
$this->_page->saveGS();
if (!strlen($barCode)) {
throw new InvalidArgumentException(Mage::helper('usa')->__('Piece Id barcode is missing'));
}
$image = new Zend_Pdf_Resource_Image_Png('data://image/png;base64,' . $barCode);
$this->_page->drawImage($image, $this->_x(29), $this->_y(476), $this->_x(261), $this->_y(555));
$this->_page->setFont($this->_fontNormal, 9);
$routingText = '(' . $dataIdentifier . ')' . $licensePlate;
$this->_page->drawText($routingText, $this->_x(144), $this->_y(563), '', Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page::ALIGN_CENTER);
$this->_page->restoreGS();
return $this;
}
示例5: _generatePdf
/**
* Generate a review portal pdf.
*
* @param integer $portalId
* @return string The pdf name
*/
protected function _generatePdf($portalId)
{
$portal = new Object_ReviewPortal($portalId);
if (!$portal->getId()) {
return false;
}
// Get the screenshots of all the portal pages.
$pages = Repo_ReviewPortalPage::getInstance()->getPortalPages($portalId);
if (!$pages || $pages->count() == 0) {
return false;
}
$pdf = new Zend_Pdf();
$pageNumber = 1;
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
$fontSize = 10;
foreach ($pages as $_p) {
$_images = array();
$_page = new Object_Page($_p->id);
// Try get static screenshots if the setting is set.
if ($_page->screenshot_type == Repo_Page::SCREENSHOT_TYPE_STATIC) {
$_images = $_page->getStaticScreenshots(true);
}
// Get dynamic one.
if (empty($_images)) {
$_images[] = Manager_ScreenCapture_Page::getInstance()->getScreenshot($_p->id);
}
foreach ($_images as $_image) {
$_pdfImage = Zend_Pdf_Image::imageWithPath($_image);
$_pdfPage = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_LETTER_LANDSCAPE);
$_pdfPage->drawImage($_pdfImage, 20, 36, $_pdfPage->getWidth() - 20, $_pdfPage->getHeight() - 20);
$_pdfPage->setFont($font, 16);
$_pdfPage->setFillColor(Zend_Pdf_Color_Html::color('#333333'))->drawText($pageNumber, $_pdfPage->getWidth() / 2, 10);
$pageNumber++;
$pdf->pages[] = $_pdfPage;
}
}
$pdfName = $portalId . '_' . time() . '.pdf';
$path = $this->_rootPath . DS . $pdfName;
$pdf->save($path);
return $pdfName;
}
示例6: insertLogo
/**
* Insert logo to pdf page
*
* @param Zend_Pdf_Page $page
* @param null $store
*/
protected function insertLogo(&$page, $store = null)
{
$this->y = $this->y ? $this->y : 815;
$image = Mage::getStoreConfig('sales/identity/logo', $store);
if ($image) {
$image = Mage::getBaseDir('media') . '/sales/store/logo/' . $image;
if (is_file($image)) {
$image = Zend_Pdf_Image::imageWithPath($image);
$top = 830;
//top border of the page
$widthLimit = 270;
//half of the page width
$heightLimit = 270;
//assuming the image is not a "skyscraper"
$width = $image->getPixelWidth();
$height = $image->getPixelHeight();
//preserving aspect ratio (proportions)
$ratio = $width / $height;
if ($ratio > 1 && $width > $widthLimit) {
$width = $widthLimit;
$height = $width / $ratio;
} elseif ($ratio < 1 && $height > $heightLimit) {
$height = $heightLimit;
$width = $height * $ratio;
} elseif ($ratio == 1 && $height > $heightLimit) {
$height = $heightLimit;
$width = $widthLimit;
}
$y1 = $top - $height;
$y2 = $top;
$x1 = 25;
$x2 = $x1 + $width;
//coordinates after transformation are rounded by Zend
$page->drawImage($image, $x1, $y1, $x2, $y2);
$this->y = $y1 - 10;
}
}
}
示例7: drawWaterMask
/**
*
* @param Zend_Pdf_Page $page
* @return void Process drawImage on PDF page
*/
protected function drawWaterMask(&$page)
{
if (Mage::getStoreConfig('advancedinvoiceprinting_options/general/enable') == 0) {
return;
}
$pageWidth = $page->getWidth();
$pageHeight = $page->getHeight();
$image = $this->getImage();
if (is_file($image)) {
/* @var $image Zend_Pdf_Resource_Image */
$image = Zend_Pdf_Image::imageWithPath($image);
$imgWidth = $image->getPixelWidth();
$imgHeight = $image->getPixelHeight();
$percent = Mage::getStoreConfig('advancedinvoiceprinting_options/general/images_size');
$imgWidth = $imgWidth * $percent / 100;
$imgHeight = $imgHeight * $percent / 100;
$x = ($pageWidth - $imgWidth) / 2;
$y = ($pageHeight - $imgHeight) / 2;
if (is_numeric(Mage::getStoreConfig('advancedinvoiceprinting_options/general/offset_x'))) {
$x = $x + (int) Mage::getStoreConfig('advancedinvoiceprinting_options/general/offset_x');
}
if (is_numeric(Mage::getStoreConfig('advancedinvoiceprinting_options/general/offset_y'))) {
$y = $y - (int) Mage::getStoreConfig('advancedinvoiceprinting_options/general/offset_y');
}
$page->drawImage($image, $x, $y, $x + $imgWidth, $y + $imgHeight);
}
}
示例8: downloadAction
public function downloadAction()
{
if ($this->_loadValidVoucher()) {
$voucherCode = $this->getRequest()->getParam('code');
$text = Mage::helper('voucher');
$_product = Mage::registry('current_product');
$pdf = new Zend_Pdf();
$page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_LETTER);
$pageHeight = $page->getHeight();
$pageWidth = $page->getWidth();
//$page->rotate(($pageWidth/2), ($pageHeight/2), 1);
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
$logoImage = Zend_Pdf_Image::imageWithPath(Mage::getDesign()->getSkinBaseDir() . '/images/logo_small_en.jpg');
//$footerImage = Zend_Pdf_Image::imageWithPath(Mage::getDesign()->getSkinBaseDir() . '/images/voucher_footer_en.png'); //VD
$productImage = Zend_Pdf_Image::imageWithPath(Mage::getBaseDir() . '/media/catalog/product' . $_product->getVoucherImage());
//$footerImageHeight = $footerImage->getPixelHeight(); //VD
//$footerImageWidth = $footerImage->getPixelWidth(); //VD
$logoImageHeight = 75;
//VDEdit
$logoImageWidth = 250;
//VDEdit
$tableWidth = 568;
$startPoint = ($pageWidth - $tableWidth) / 2;
$endPoint = $startPoint + $tableWidth;
$botPoint = 10;
$topPoint = $pageHeight - 30;
$page->setLineWidth('0.3')->setLineDashingPattern(array(3, 3, 3, 3))->drawLine($startPoint, $topPoint, $startPoint, $botPoint)->drawLine($endPoint, $topPoint, $endPoint, $botPoint)->drawLine($startPoint, $topPoint, $endPoint, $topPoint)->drawLine($startPoint, $botPoint, $endPoint, $botPoint)->drawLine($startPoint, $pageHeight - $logoImageHeight - 235, $endPoint, $pageHeight - $logoImageHeight - 235)->drawLine($startPoint, $pageHeight - $logoImageHeight - 235 - 325, $endPoint, $pageHeight - $logoImageHeight - 235 - 325);
$page->setFillColor(Zend_Pdf_Color_Html::color('#16599D'))->drawRectangle($startPoint + 2, $topPoint - $logoImageHeight - 2, $endPoint, $topPoint);
$page->drawImage($logoImage, $startPoint, $topPoint - $logoImageHeight - 1, $startPoint + $logoImageWidth, $topPoint);
//$page->drawImage($footerImage, $startPoint + 2, $botPoint, $startPoint + $footerImageWidth - 20, $botPoint + $footerImageHeight);
$page->drawImage($productImage, $startPoint + 7, $topPoint - 55 - $productImage->getPixelHeight(), $startPoint + 7 + 246, $topPoint - 55 - $productImage->getPixelHeight() + 165);
$page->setFillColor(Zend_Pdf_Color_Html::color('#FFFFFF'))->setLineDashingPattern(array(1, 0, 1, 0))->drawRectangle($endPoint - 205, $topPoint - 10, $endPoint - 15, $topPoint + 10)->setLineDashingPattern(array(0, 1000, 0, 1000))->setFillColor(Zend_Pdf_Color_Html::color('#EDF4FA'))->drawRectangle($startPoint + 0.3, $pageHeight - $logoImageHeight - 235, $endPoint, $pageHeight - $logoImageHeight - 235 - 325);
$style = new Zend_Pdf_Style();
$style->setFont($font, 15);
$page->setFont($font, 12)->setFillColor(Zend_Pdf_Color_Html::color('#000000'))->drawText($text->__('Voucher Code: ' . $voucherCode), $endPoint - 193, $topPoint - 4)->setFont($font, 15);
$lines = explode("\n", $this->getWrappedText($text->__('Voucher for ') . $_product->getName(), $style, 270));
//var_dump($lines);
foreach ($lines as $k => $line) {
$page->drawText($line, $startPoint + $productImage->getPixelWidth() + 20, $topPoint - 70 - $k * 20);
}
//
$pdf->pages[0] = $page;
$pdf->save(Mage::getBaseDir() . '/media/vouchers/' . $voucherCode . '.pdf');
$this->getResponse()->clearHeaders()->setHeader('content-type:', 'Application/pdf')->setHeader('Content-Type', 'application/force-download')->setHeader('Content-Disposition', 'attachment; filename="' . $voucherCode . '.pdf"')->setBody($pdf->render());
}
}
示例9: insertLogo
/**
* Insert logo to PDF object
*
* @param Zend_Pdf_Page $page
* @param null $store
*/
protected function insertLogo(&$page, $store = null)
{
$this->y = $this->y ? $this->y : 815;
$image = Mage::getStoreConfig('sales/identity/logo', $store);
$collection = Mage::getModel('marketplace/userprofile')->getCollection()->addFieldToFilter('mageuserid', array('eq' => Mage::getSingleton('customer/session')->getCustomerId()));
foreach ($collection as $row) {
$image = $row->getLogopic();
}
if ($image) {
$image = Mage::getBaseDir('media') . '/avatar/' . $image;
if (is_file($image)) {
$extension = pathinfo($image, PATHINFO_EXTENSION);
$extension_allowed = array("jpeg", "tiff", "png");
if (in_array($extension, $extension_allowed)) {
$image = Zend_Pdf_Image::imageWithPath($image);
$top = 830;
//top border of the page
$widthLimit = 270;
//half of the page width
$heightLimit = 270;
//assuming the image is not a "skyscraper"
$width = $image->getPixelWidth();
$height = $image->getPixelHeight();
//preserving aspect ratio (proportions)
$ratio = $width / $height;
if ($ratio > 1 && $width > $widthLimit) {
$width = $widthLimit;
$height = $width / $ratio;
} elseif ($ratio < 1 && $height > $heightLimit) {
$height = $heightLimit;
$width = $height * $ratio;
} elseif ($ratio == 1 && $height > $heightLimit) {
$height = $heightLimit;
$width = $widthLimit;
}
$y1 = $top - $height;
$y2 = $top;
$x1 = 25;
$x2 = $x1 + $width;
//coordinates after transformation are rounded by Zend
$page->drawImage($image, $x1, $y1, $x2, $y2);
$this->y = $y1 - 10;
}
}
}
}
示例10: pdfdisplayAction
function pdfdisplayAction()
{
$convertdate = new App_Model_dateConvertor();
// echo '<pre>'; print_r($this->_request->getParam('accNum'));
$this->view->details = $this->view->loanModel->searchaccounts($this->_request->getParam('accNum'));
//echo '<pre>'; print_r($this->view->details);
$this->view->tran = $this->view->loanModel->loanInstalments($this->_request->getParam('accNum'));
$this->view->paid = $this->view->loanModel->paid($this->_request->getParam('accNum'));
$this->view->unpaid = $this->view->loanModel->unpaid($this->_request->getParam('accNum'));
// $loansearch = new Loandetailsg_Form_Search();
// $loantransactions = new Loandisbursmentg_Model_loan();
$app = $this->view->baseUrl();
$word = explode('/', $app);
$projname = $word[1];
$pdf = new Zend_Pdf();
$page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
$pdf->pages[] = $page;
// Image
$image_name = "/var/www/" . $projname . "/public/images/logo.jpg";
$image = Zend_Pdf_Image::imageWithPath($image_name);
$page->drawImage($image, 30, 770, 130, 820);
$page->setLineWidth(1)->drawLine(25, 25, 570, 25);
//bottom horizontal
$page->setLineWidth(1)->drawLine(25, 25, 25, 820);
//left vertical
$page->setLineWidth(1)->drawLine(570, 25, 570, 820);
//right vertical
$page->setLineWidth(1)->drawLine(570, 820, 25, 820);
//top horizontal
$page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 8);
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
$page->drawText('( LOAN LEDGER )', 237, 780);
$text = array("Member details");
$x0 = 50;
$x3 = 310;
$x1 = 150;
$x2 = 220;
$page->drawLine(50, 740, 290, 740);
$page->drawLine(50, 720, 290, 720);
$page->drawText($text[0], 90, 727);
$y1 = 700;
foreach ($this->view->details as $details) {
$page->drawText('Name : ' . $details->name, $x0, $y1);
$y1 = $y1 - 20;
$page->drawText('Branch : ' . $details->officename, $x0, $y1);
$y1 = $y1 - 20;
$page->drawText('Code : ' . $details->code, $x0, $y1);
$y1 = $y1 - 20;
$page->drawText('Account code : ' . $details->number, $x0, $y1);
$text1 = array("Loan details");
$y1 = $y1 - 25;
$page->drawLine(50, $y1, 290, $y1);
$y1 = $y1 - 20;
$page->drawLine(50, $y1, 290, $y1);
$y1 = $y1 + 7;
$page->drawText($text1[0], 90, $y1);
$y1 = $y1 - 25;
$page->drawText('Loan name : ' . $details->loanname, $x0, $y1);
$y1 = $y1 - 20;
$page->drawText('Loan amount Rs : ' . $details->amount, $x0, $y1);
$y1 = $y1 - 20;
$page->drawText('Interest rate % : ' . $details->interest, $x0, $y1);
$y1 = $y1 - 20;
$page->drawText('Installments : ' . $details->installments, $x0, $y1);
$y1 = $y1 - 20;
$page->drawText('Sanctioned date : ' . $details->sanctioned, $x0, $y1);
$y1 = $y1 - 20;
}
$y1 = 740;
$text2 = array("Installment status No Amount");
$page->drawLine(310, $y1, 550, $y1);
$y1 = $y1 - 20;
$page->drawLine(310, $y1, 550, $y1);
$y1 = $y1 + 7;
$page->drawText($text2[0], $x3, $y1);
foreach ($this->view->paid as $paid) {
$y1 = $y1 - 25;
$page->drawText('Paid' . $paid->paidAmt, 320, $y1);
$page->drawText($paid->paidCount, 390, $y1);
}
foreach ($this->view->unpaid as $unpaid) {
$y1 = $y1 - 20;
$page->drawText('Due', 320, $y1);
$page->drawText($unpaid->unpaidCount, 390, $y1);
$page->drawText($unpaid->unpaidAmt, 430, $y1);
}
$y1 = 480;
$text3 = array("GL.LF no Transaction date Creidt Debit Payment mode Transacted by ");
$page->drawLine(50, $y1, 550, $y1);
$y1 = $y1 - 20;
$page->drawLine(50, $y1, 550, $y1);
$y1 = $y1 + 7;
$page->drawText($text3[0], $x0, $y1);
foreach ($this->view->tran as $transaction) {
$y1 = $y1 - 20;
$page->drawText($transaction->id, 60, $y1);
$page->drawText($transaction->date, 120, $y1);
$page->drawText($transaction->cr, 160, $y1);
$page->drawText($transaction->dt, 250, $y1);
$page->drawText($transaction->mode, 330, $y1);
//.........这里部分代码省略.........
示例11: pdfdisplayAction
function pdfdisplayAction()
{
$declarationform = new Externalloan_Model_Dec();
$this->view->form = $declarationform;
$postdata = $this->_request->getpost();
//echo '<pre>'; print_r($postdata);
$this->view->membercode = $memcode = $postdata['membercode'];
//echo $this->view->membercode.'<br>';
$this->view->moduleid = $moduleid = $postdata['module_id'];
$this->view->groupresult = $results = $this->view->dbobj->groupDeatils($memcode, $moduleid);
$this->view->groupmember = $membername = $this->view->dbobj->getmember($memcode);
$this->view->represent = $repname = $this->view->dbobj->represent($memcode);
$this->view->loans = $loans = $this->view->dbobj->getgrouploans($memcode);
$app = $this->view->baseUrl();
$word = explode('/', $app);
$projname = $word[1];
$pdf = new Zend_Pdf();
$page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
$pdf->pages[] = $page;
// Image
$image_name = "/var/www/" . $projname . "/public/images/logo.jpg";
$image = Zend_Pdf_Image::imageWithPath($image_name);
//$page->drawImage($image, 25, 770, 570, 820);
$page->drawImage($image, 30, 770, 130, 820);
$page->setLineWidth(1)->drawLine(25, 25, 570, 25);
//bottom horizontal
$page->setLineWidth(1)->drawLine(25, 25, 25, 820);
//left vertical
$page->setLineWidth(1)->drawLine(570, 25, 570, 820);
//right vertical
$page->setLineWidth(1)->drawLine(570, 820, 25, 820);
//top horizonta
// define font resource
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
// Image
$image_name = "/var/www/" . $projname . "/public/images/logo.jpg";
$image = Zend_Pdf_Image::imageWithPath($image_name);
$x1 = 72;
$x2 = 410;
$y1 = 670;
//$y2=;
$memcode = $this->_request->getParam('membercode');
$moduleid = $this->_request->getParam('module_id');
// echo '<pre>'; print_r($this->view->groupresult);
$dateconvert = new App_Model_dateConvertor();
foreach ($this->view->groupresult as $result) {
foreach ($this->view->represent as $name) {
foreach ($this->view->groupmember as $memberview) {
// write text to page
$page->setFont($font, 10)->drawText('( EXTERNAL LOAN REQUEST )', 237, 720);
$page->setFont($font, 9)->drawText('Group name :' . $result['name'] . '', $x1, $y1);
$page->setFont($font, 9)->drawText('Date :' . date('d-m-Y') . '', $x2, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('Group Address :' . $result['address1'] . '', $x1, $y1);
$page->setFont($font, 9)->drawText('Group code :' . $result['groupcode'] . '', $x2, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('' . $result['city'] . '', 137, $y1);
$page->setFont($font, 9)->drawText('Savings A/c :' . $result['account_number'] . '', $x2, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('' . $result['state'] . '', 137, $y1);
foreach ($this->view->loans as $loan) {
$page->setFont($font, 9)->drawText('Loan A/c :' . $loan['loanaccount'] . '', $x2, $y1);
}
// // $y1=$y1-15;
// // $page->setFont($font, 9)
// // ->drawText('Communication:phone/mobile :'.$loan['mobile'].'',$x1, $y1);
$y1 = $y1 - 10;
$page->setLineWidth(1)->drawLine(50, $y1, 550, $y1);
$y1 = $y1 - 25;
$page->setFont($font, 9)->drawText('1...' . $result['purpose'] . '...(PURPOSE)sfjhkjh kjhjhjdhfjn dhfjkasdhfjh..' . $result['bankname'] . '..(BANK)afd/saa/sdb', $x1, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('..' . $result['branchname'] . '..(Branch name) asdbnhhjh saoinm (LOAN AMOUNT)..' . $result['amount'] . '...ajjnsabvcui uwepiyqwne bodaftutguy nhgqwe.', $x1, $y1);
$y1 = $y1 - 20;
$page->setFont($font, 9)->drawText('2. aujhhjuoer uiuhjn jhsfduio uyhuasmuiohjos iuiowsmhns8u ujmnasusm sjuhm,asdfiu ', $x1, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('1) ' . $name['memnames'] . '', 150, $y1);
$y1 = $y1 - 25;
$page->setFont($font, 9)->drawText('aujhhjuoer uiuhjn jhsfduio uyhuasmuiohjos iuiowsmhns8u ujmnasusm sjuhm,asdfiu ', $x1, $y1);
$y1 = $y1 - 15;
$page->setLineWidth(1)->drawLine(50, $y1, 550, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('S.No', 80, $y1);
$page->setFont($font, 9)->drawText('Member Name', 150, $y1);
$page->setFont($font, 9)->drawText('Purpose', 270, $y1);
$page->setFont($font, 9)->drawText('Loan request', 360, $y1);
$page->setFont($font, 9)->drawText('Signature', 450, $y1);
$y1 = $y1 - 10;
$page->setLineWidth(1)->drawLine(50, $y1, 550, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('' . $memberview['memname'] . '', 150, $y1);
$page->setFont($font, 9)->drawText('' . $memberview['purposename'] . '', 260, $y1);
$page->setFont($font, 9)->drawText('' . $memberview['Amount'] . '', 365, $y1);
$y1 = $y1 - 10;
$page->setLineWidth(1)->drawLine(50, $y1, 550, $y1);
$y1 = $y1 - 50;
$pdf->pages[] = $page;
$pdfData = $pdf->render();
$pdfData = $pdf->render();
$pdf->save('/var/www/' . $projname . '/reports/externalloan.pdf');
$path = '/var/www/' . $projname . '/reports/externalloan.pdf';
//.........这里部分代码省略.........
示例12: pdfdisplayAction
function pdfdisplayAction()
{
$app = $this->view->baseUrl();
$word = explode('/', $app);
$projname = $word[1];
$pdf = new Zend_Pdf();
$page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
$pdf->pages[] = $page;
// Image
$image_name = "/var/www/" . $projname . "/public/images/logo.jpg";
$image = Zend_Pdf_Image::imageWithPath($image_name);
//$page->drawImage($image, 25, 770, 570, 820);
$page->drawImage($image, 30, 770, 130, 820);
$page->setLineWidth(1)->drawLine(25, 25, 570, 25);
//bottom horizontal
// $page->setLineWidth(1)->drawLine(25, 640, 25, 500);
$page->setLineWidth(1)->drawLine(25, 25, 25, 820);
//left vertical
$page->setLineWidth(1)->drawLine(570, 25, 570, 820);
//right vertical
$page->setLineWidth(1)->drawLine(570, 820, 25, 820);
//top horizonta
// define font resource
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
// Image
$image_name = "/var/www/" . $projname . "/public/images/logo.jpg";
$image = Zend_Pdf_Image::imageWithPath($image_name);
$x1 = 72;
$x2 = 410;
$y1 = 690;
$Declaration = new Declaration_Model_Dec();
$code = $this->_request->getParam('groupcode');
$this->view->result = $this->view->loan->groupDeatils($code);
$this->view->groupmembers = $this->view->loan->getgroupmembers($code);
$dateconvert = new App_Model_dateConvertor();
foreach ($this->view->result as $result) {
// // write text to page
$page->setFont($font, 12)->drawText('Group bye law', 240, 720);
$page->setFont($font, 9)->drawText('The vision of Ourbank is to stimulate local development by offering small and medium ', $x1, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('The vision of Ourbank is to stimulate local development by offering small and medium ', $x1, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('The vision of Ourbank is to stimulate local development by offering small and medium ', $x1, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('The vision of Ourbank is to stimulate ' . $result['dayname'] . 'The vision of Ourbank is to stimulate ', $x1, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('The vision of Ourbank is to ' . $result['place'] . ' stimulate local development by offering small and medium ', $x1, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('The vision of Ourbank is to stimulate ' . $result['saving_perweek'] . ' pment by offering small and medium ', $x1, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('The vision of Ourbank is to stimu ' . $result['rateinterest'] . ' velopment by offering small and medium ', $x1, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('The vision of Ourbank is to stim ' . $result['penalty_latecoming'] . ' evelopment by offering small and medium ', $x1, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('The vision of Ourbank is to stim ' . $result['penalty_notcoming'] . ' velopment by offering small and medium ', $x1, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('The vision of Ourbank is to st ' . $result['group_created_date'] . ' elopment by offering small and medium ', $x1, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('The vision of Ourbank is to stimu ' . $result['name'] . ' elopment by offering small and medium ', $x1, $y1);
$y1 = $y1 - 15;
$page->setLineWidth(1)->drawLine(50, $y1, 550, $y1);
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('Member name', 72, $y1);
$page->setFont($font, 9)->drawText('UID', 160, $y1);
$page->setFont($font, 9)->drawText('Father name', 200, $y1);
$page->setFont($font, 9)->drawText('Nominee', 280, $y1);
$page->setFont($font, 9)->drawText('Nominee relationship', 350, $y1);
$page->setFont($font, 9)->drawText('Signature', 460, $y1);
$y1 = $y1 - 10;
$page->setLineWidth(1)->drawLine(50, $y1, 550, $y1);
foreach ($this->view->groupmembers as $member) {
$y1 = $y1 - 15;
$page->setFont($font, 9)->drawText('' . $member['membername'] . '', 72, $y1);
$page->setFont($font, 9)->drawText('' . $member['uid'] . '', 140, $y1);
$page->setFont($font, 9)->drawText('' . $member['family_id'] . '', 200, $y1);
$y1 = $y1 - 10;
$page->setLineWidth(1)->drawLine(50, $y1, 550, $y1);
}
}
$pdf->pages[] = $page;
$pdfData = $pdf->render();
$pdfData = $pdf->render();
$pdf->save('/var/www/' . $projname . '/reports/grouplaw.pdf');
$path = '/var/www/' . $projname . '/reports/grouplaw.pdf';
chmod($path, 0777);
// $this->_redirect('/declaration/index');
}
示例13: assinaturas
private function assinaturas(Zend_Pdf_Page $page, $idEncontro = 0)
{
if ($idEncontro > 0) {
$dir = APPLICATION_PATH . "/../public/img/certificados/{$idEncontro}/";
if (!is_dir($dir)) {
$dir = APPLICATION_PATH . "/../public/img/certificados/default/";
}
}
if (!is_dir($dir)) {
throw new Exception("É necessário que o diretório {$dir} exista.");
}
$file = "{$dir}/assinatura-%d.png";
$maxAssinaturas = 3;
for ($index = 0; $index < $maxAssinaturas; $index++) {
$auxFile = sprintf($file, $index + 1);
if (file_exists($auxFile)) {
$image = Zend_Pdf_Image::imageWithPath($auxFile);
$page->drawImage($image, Sige_Pdf_Certificado::POS_X1_INI_ASSINATURA + $index * Sige_Pdf_Certificado::DES_X, Sige_Pdf_Certificado::POS_Y1_ASSINATURA, Sige_Pdf_Certificado::POS_X2_INI_ASSINATURA + $index * Sige_Pdf_Certificado::DES_X, Sige_Pdf_Certificado::POS_Y2_ASSINATURA);
}
}
}
示例14: DrawHeader
protected static function DrawHeader(Zend_Pdf_Page $objPage)
{
$intY = STEWARDSHIP_TOP - 5 / 8 * 72;
$intY -= 13.2;
$objPage->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA_BOLD), 12);
$objPage->drawText(STEWARDSHIP_STATEMENT_LINE_1, 36, $intY, 'UTF-8');
$intY -= 9.199999999999999;
$objPage->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 8);
$objPage->drawText(STEWARDSHIP_STATEMENT_LINE_2, 36, $intY, 'UTF-8');
$intY -= 12.1;
$objPage->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 11);
$objPage->drawText(STEWARDSHIP_STATEMENT_LINE_3, 36, $intY, 'UTF-8');
$intY -= 12.1;
$objPage->drawText(STEWARDSHIP_STATEMENT_LINE_4, 36, $intY, 'UTF-8');
if (!self::$ZendImage) {
self::$ZendImage = Zend_Pdf_Image::imageWithPath(__DOCROOT__ . __IMAGE_ASSETS__ . '/alcf_logo_stewardship.png');
}
$objPage->drawImage(self::$ZendImage, 424, STEWARDSHIP_TOP - 108, 576, STEWARDSHIP_TOP - 36);
}
示例15: createPdfPageFromImageString
/**
* Create Zend_Pdf_Page instance with image from $imageString. Supports JPEG, PNG, GIF, WBMP, and GD2 formats.
*
* @param string $imageString
* @return Zend_Pdf_Page|bool
*/
public function createPdfPageFromImageString($imageString)
{
$image = imagecreatefromstring($imageString);
if (!$image) {
return false;
}
$xSize = imagesx($image);
$ySize = imagesy($image);
$page = new Zend_Pdf_Page($xSize, $ySize);
imageinterlace($image, 0);
$tmpFileName = sys_get_temp_dir() . DS . 'shipping_labels_' . uniqid(mt_rand()) . time() . '.png';
imagepng($image, $tmpFileName);
$pdfImage = Zend_Pdf_Image::imageWithPath($tmpFileName);
$page->drawImage($pdfImage, 0, 0, $xSize, $ySize);
unlink($tmpFileName);
return $page;
}