当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Pdf_Image类代码示例

本文整理汇总了PHP中Zend_Pdf_Image的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Pdf_Image类的具体用法?PHP Zend_Pdf_Image怎么用?PHP Zend_Pdf_Image使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Zend_Pdf_Image类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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;
 }
开发者ID:kemeice,项目名称:Giftcards,代码行数:26,代码来源:Pdf.php

示例2: _addPaidIcon

 protected function _addPaidIcon(&$page)
 {
     $image = Mage::helper('emjainteractive_purchaseordermanagement')->getIconFullPath();
     if (is_file($image)) {
         $image = Zend_Pdf_Image::imageWithPath($image);
         $page->drawImage($image, 220, 600, 280, 650);
     }
     return $this;
 }
开发者ID:flintdigital,项目名称:mage-mod-ar-po-emja,代码行数:9,代码来源:Pdf.php

示例3: process

 public function process($page, &$column, &$top, $lineSpacing, $pdf)
 {
     $info = $column['info'];
     if (isset($info['image']) && strlen($info['image']) > 0) {
         $image = Zend_Pdf_Image::imageWithPath($info['image']);
         $page->drawImage($image, $column['feed'], $pdf->y - 50, $column['feed'] + 50, $pdf->y);
         $top += 60;
     }
 }
开发者ID:hoadaithieu,项目名称:mage-giftwrap,代码行数:9,代码来源:Image.php

示例4: drawLogo

 /**
  * Place vendor logo into page
  * @param $page
  */
 public function drawLogo($page)
 {
     $vendorId = Mage::getSingleton('udropship/session')->getId();
     $vendor = Mage::helper('udropship')->getVendor($vendorId);
     $img = Mage::getBaseDir('media') . DS . $vendor->getLogo();
     if (is_file($img)) {
         $image = Zend_Pdf_Image::imageWithPath($img);
         $page->drawImage($image, 25, 805, 125, 830);
     }
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:14,代码来源:Shipment.php

示例5: insertLogo

 /**
  * Insert le logo
  *
  * @param unknown_type $page
  */
 protected function insertLogo(&$page, $StoreId = null)
 {
     $image = Mage::getStoreConfig('sales/identity/logo', $StoreId);
     if ($image) {
         $image = Mage::getStoreConfig('system/filesystem/media') . '/sales/store/logo/' . $image;
         if (is_file($image)) {
             $image = Zend_Pdf_Image::imageWithPath($image);
             $page->drawImage($image, 25, 785, 25 + $this->_LOGO_LARGEUR, 785 + $this->_LOGO_HAUTEUR);
         }
     }
     //return $page;
 }
开发者ID:TrygveSkogsholm,项目名称:Magento-Patch,代码行数:17,代码来源:Pdfhelper.php

示例6: insertLogo

 protected function insertLogo(&$page, $store = null)
 {
     $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);
             $page->drawImage($image, 25, 800, 125, 825);
         }
     }
     //return $page;
 }
开发者ID:shashankkanungo,项目名称:magento,代码行数:12,代码来源:SM_Vendors_Model_Override_Sales_Order_Pdf_Abstract.php

示例7: insertImage

 /**
  * create a order pdf modelled on the invoice content
  *
  * @param array $orders
  *
  * @return Zend_Pdf
  */
 protected function insertImage($imageLocation, $x1, $y1, $x2, $y2, $width, $height, &$page)
 {
     try {
         $width = (int) $width;
         $height = (int) $height;
         //Get product image and resize it
         $image = Zend_Pdf_Image::imageWithPath($imageLocation);
         //Draw image to PDF
         $page->drawImage($image, $x1, $y1, $x2, $y2);
     } catch (Exception $e) {
         return false;
     }
 }
开发者ID:FranchuCorraliza,项目名称:magento,代码行数:20,代码来源:Order.php

示例8: setHeader

 public function setHeader()
 {
     $this->_page->saveGS();
     $this->_page->setFont($this->_normalFont, 10);
     $this->_page->drawText('ỦY BAN NHÂN DÂN', $this->_leftMargin + 52, $this->_pageHeight - 22, 'UTF-8')->drawText('THÀNH PHÔ HỒ CHÍ MINH', $this->_leftMargin + 40, $this->_pageHeight - 34, 'UTF-8');
     $this->_page->setFont($this->_boldFont, 11);
     $this->_page->drawText('TRƯỜNG ĐẠI HỌC SÀI GÒN', $this->_leftMargin + 30, $this->_pageHeight - 46, 'UTF-8');
     $this->_page->setLineWidth(0.1);
     $this->_page->drawLine($this->_leftMargin + 60, $this->_pageHeight - 50, $this->_pageWidth - 437, $this->_pageHeight - 50);
     $this->_page->setFont($this->_boldFont, 11);
     $this->_page->drawText('CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM', $this->_leftMargin + 300, $this->_pageHeight - 22, 'UTF-8');
     $this->_page->setFont($this->_normalFont, 11);
     $this->_page->drawText('Độc lập - Tự do - Hạnh phúc', $this->_leftMargin + 340, $this->_pageHeight - 34, 'UTF-8');
     //--------------drawImage(image, left, bottom, right, top)
     $imagePath = Zend_Pdf_Image::imageWithPath(APPLICATION_PATH . '/templates/admin/images/symbol.png');
     $this->_page->drawImage($imagePath, $this->_leftMargin + 380, $this->_pageHeight - 49, $this->_leftMargin + 415, $this->_pageHeight - 39);
     $this->_page->restoreGS();
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:18,代码来源:Page.php

示例9: generate

 /**
  * Generate a QR code for the given data.
  *
  * @return Zend_Pdf_Image
  */
 public function generate($data)
 {
     $temp = tempnam($this->_tempDir, self::TEMP_FILE_PREFIX);
     // Zend_Pdf_Image dies if lacking the correct file extension.
     $tempPng = $temp . ".png";
     rename($temp, $tempPng);
     $temp = $tempPng;
     $url = $this->_qrCodeUri($data);
     $client = new Omeka_Http_Client($url);
     $client->setMaxRetries(10);
     $response = $client->request('GET');
     if ($response->isSuccessful()) {
         file_put_contents($temp, $response->getBody());
         $image = Zend_Pdf_Image::imageWithPath($temp);
         unlink($temp);
         return $image;
     } else {
         throw new Zend_Http_Client_Exception("Could not retrieve QR chart from Google.");
     }
 }
开发者ID:ungc0,项目名称:comp356-mac15,代码行数:25,代码来源:GoogleCharts.php

示例10: insertLogo17

 protected function insertLogo17(&$page, $store = null)
 {
     $this->y = $this->y ? $this->y : 800;
     $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;
         }
     }
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:38,代码来源:Shipment.php

示例11: pdftransactionAction

 function pdftransactionAction()
 {
     $fromdate = $this->_request->getParam('fdate');
     $dateconvertor = new App_Model_dateConvertor();
     $Date = $dateconvertor->mysqlformat($fromdate);
     $this->view->fdate = $Date;
     $asofDate = $dateconvertor->normalformat($fromdate);
     $this->view->asofdate = $asofDate;
     $incomeexpenditure = new Incomeexpenditure_Model_Incomeexpenditure();
     $this->view->income = $income = $incomeexpenditure->incomedetails($Date);
     $this->view->expenditure = $expenditure = $incomeexpenditure->expendituredetails($Date);
     $app = $this->view->baseUrl();
     $word = explode('/', $app);
     $projname = '';
     for ($i = 0; $i < count($word); $i++) {
         if ($i > 0 && $i < count($word) - 1) {
             $projname .= '/' . $word[$i];
         }
     }
     $pdf = new Zend_Pdf();
     $page = $pdf->newPage(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, 20, 780, 120, 830);
     $page->setLineWidth(1)->drawLine(20, 20, 580, 20);
     //bottom horizontal
     $page->setLineWidth(1)->drawLine(20, 20, 20, 830);
     //left vertical
     $page->setLineWidth(1)->drawLine(580, 25, 580, 830);
     //right vertical
     $page->setLineWidth(1)->drawLine(20, 830, 580, 830);
     //top horizontal
     $x1 = 45;
     $x2 = 250;
     $x3 = 330;
     $x4 = 500;
     $my = 735;
     $y1 = 710;
     $y2 = 710;
     $totalincome = 0;
     $totalexpe = 0;
     //set the font
     $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 8);
     $text = array($this->view->translate('Income and Expenditure'), $this->view->translate('Income'), $this->view->translate('Amount'), $this->view->translate('Expenditure'), $this->view->translate('Amount'), $this->view->translate('Grand total'));
     $criteria = $this->view->translate('As of') . " " . $asofDate;
     $currency = "* " . $this->view->translate('Amount in Rs');
     // // // file:///var/www/IDF/application/modules/incomeexpenditure/controllers/IndexController.php
     /*$page->drawText("Date : ".date('d/m/Y'),500, 800); //date('Y-m-d')
       $page->drawText("Date : ".date('d/m/Y'),500, 800);*/
     $page->drawText($text[0], 185, 780);
     $page->drawText($text[0], 185, 780);
     $page->drawText($criteria, 500, 780);
     //Search criteria
     $page->drawText($criteria, 500, 780);
     $page->drawText($currency, 500, 770);
     //Currency
     $page->drawText($currency, 500, 770);
     $page->drawText($text[1], $x1, $my);
     $page->drawText($text[2], $x2, $my);
     $page->drawText($text[3], $x3, $my);
     $page->drawText($text[4], $x4, $my);
     $page->drawLine(30, 750, 570, 750);
     $page->drawLine(30, 730, 570, 730);
     foreach ($income as $income) {
         $page->drawText($income['header'], $x1, $y1);
         $page->drawText($income['credit'], $x2, $y1);
         $totalincome += $income['credit'];
         $y1 = $y1 - 15;
     }
     foreach ($expenditure as $expe) {
         $page->drawText($expe['header'], $x3, $y2);
         $page->drawText($expe['credit'], $x4, $y2);
         $totalexpe += $expe['credit'];
         $y2 = $y2 - 15;
     }
     $page->drawLine(30, $y1, 570, $y1);
     $page->drawLine(30, $y1 - 20, 570, $y1 - 20);
     $page->drawText($text[5], $x1, $y1 - 15);
     $page->drawText(sprintf("%4.2f", $totalincome), $x2, $y1 - 15);
     $page->drawText($text[5], $x3, $y1 - 15);
     $page->drawText(sprintf("%4.2f", $totalexpe), $x4, $y1 - 15);
     // Virtual table
     $page->setLineWidth(1)->drawLine(30, $y1 - 20, 30, 750);
     //Table left vertical
     $page->setLineWidth(1)->drawLine(300, $y1 - 20, 300, 750);
     //Table center vertical
     $page->setLineWidth(1)->drawLine(570, $y1 - 20, 570, 750);
     //table rigth vertical
     $pdfData = $pdf->render();
     $account_number = $Date;
     // 		$pdf->save('/var/www/ourbank/reports/incomeexpenditure.pdf');
     //$path = '/var/www/ourbank/reports/incomeexpenditure.pdf';
     $pdf->save('/var/www/' . $projname . '/reports/' . $account_number . 'incomeexpenditure.pdf');
     $path = '/var/www/' . $projname . '/reports/' . $account_number . 'incomeexpenditure.pdf';
     chmod($path, 0777);
 }
开发者ID:maniargaurav,项目名称:OurBank,代码行数:99,代码来源:IndexController.php

示例12: pdfAction

 public function pdfAction()
 {
     //$oid = $this->getRequest()->getParams('orderid');
     //echo $oid;
     $last_order_id = Mage::getSingleton('checkout/session')->getLastOrderId();
     $pre_order_id = $last_order_id - 1;
     $pre_order = Mage::getModel('sales/order')->load($pre_order_id);
     $pre_deposit_val = $pre_order->getDepositId();
     $current_deposit_value = $pre_deposit_val + 1;
     $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
     $connection->beginTransaction();
     $__fields = array();
     $__fields['deposit_id'] = $current_deposit_value;
     $__where = $connection->quoteInto('entity_id =?', $last_order_id);
     $connection->update('zaybx_sales_flat_order', $__fields, $__where);
     $connection->commit();
     $curr_order = Mage::getModel('sales/order')->load($last_order_id);
     $display_deposit = $curr_order->getDepositId();
     $strlen = strlen($display_deposit);
     if ($strlen == 1) {
         $original_deposit_id = "00000" . $display_deposit;
     } else {
         if ($strlen == 2) {
             $original_deposit_id = "0000" . $display_deposit;
         } else {
             if ($strlen == 3) {
                 $original_deposit_id = "000" . $display_deposit;
             } else {
                 if ($strlen == 4) {
                     $original_deposit_id = "00" . $display_deposit;
                 } else {
                     if ($strlen == 5) {
                         $original_deposit_id = "0" . $display_deposit;
                     } else {
                         $original_deposit_id = $display_deposit;
                     }
                 }
             }
         }
     }
     $order = Mage::getModel('sales/order');
     $order_id = $this->getRequest()->getParams('orderid');
     $order->loadByIncrementId($order_id);
     $payment_method_code = $order->getPayment()->getMethodInstance()->getCode();
     $customername = $order->getCustomerFirstname() . ' ' . $order->getCustomerLastname();
     //$currentdate = Mage::getModel('core/date')->date('Y-m-d H:i:s');
     $currentdate = Mage::getModel('core/date')->date('d-m-Y');
     $depositno = mt_rand(01, 100000);
     //$depositno = '000001';
     $grandtotal = floatval(round($order->getGrandTotal(), 2));
     $total = floatval(round($order->getGrandTotal(), 2));
     $companyname = 'CLEARTHINK SOFTWARE PRIVATE LIMITED.';
     $clientcode = 'CLRTNKSFTW';
     $localchq = $order->getPayment()->getCheqloc();
     if ($localchq == 1) {
         $local = '';
         $out = '';
     } else {
         $local = '';
         $out = '';
     }
     // $localchqdd = $order->getPayment()->getCheqlocdd();
     // if($localchqdd == 1){
     // $local = 'Yes';
     // $out = 'No';
     // }else{
     // $local = 'No';
     // $out = 'Yes';
     // }
     $order_ic_id = $order->getIncrementId();
     $checkno = $order->getPayment()->getCheckNo();
     $chqdate = $order->getPayment()->getCheckDate();
     $draweename = $order->getPayment()->getDraweename();
     $draweebank = $order->getPayment()->getDraweebank();
     $panno = $order->getPayment()->getPanno();
     $dd_no = $order->getPayment()->getDdNo();
     $dd_date = $order->getPayment()->getDdDate();
     $draweenamedd = $order->getPayment()->getDraweenamedd();
     $draweebankdd = $order->getPayment()->getDraweebankdd();
     // Create new PDF
     $pdf = new Zend_Pdf();
     //Mage::log(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'frontend/sm_market/default/images/pdf/cheque.jpg');
     // Add new page to the document
     $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4_LANDSCAPE);
     // define font resource
     $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
     // set font for page
     // write text to page
     // $page->setFont($font, 24)
     // ->drawText('That which we call a rose,', 72, 720)
     // ->drawText('By any other name would smell as sweet.', 72, 620);
     $pdf->pages[] = $page;
     if ($payment_method_code == 'paymentmodulepackbankin') {
         $image = Zend_Pdf_Image::imageWithPath('skin/frontend/default/msupply/images/pdf/dd.jpg');
         $page->drawImage($image, 50, 100, 772, 496);
         $page->setFont($font, 10)->drawText($companyname, 142, 418);
         $page->setFont($font, 10)->drawText($clientcode, 120, 355);
         // $page->setFont($font,10)->drawText($local,160,385);
         // $page->setFont($font,10)->drawText($out,380,385);
         $page->setFont($font, 10)->drawText($currentdate, 310, 355);
//.........这里部分代码省略.........
开发者ID:mSupply,项目名称:runnable_test_repo,代码行数:101,代码来源:IndexController.php

示例13: getPdf

 public function getPdf($couponIds)
 {
     // $this->_beforeGetPdf();
     if ($couponIds) {
         $pdf = new Zend_Pdf();
         $this->_setPdf($pdf);
         $style = new Zend_Pdf_Style();
         $this->_setFontBold($style, 10);
         $couponIds = array_chunk($couponIds, 8);
         foreach ($couponIds as $coupons) {
             $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
             $pdf->pages[] = $page;
             $this->y = 790;
             $i = 0;
             foreach ($coupons as $couponId) {
                 $couponOffer = $this->_getCouponById($couponId);
                 if ($couponOffer->getId()) {
                     $i++;
                     if ($i % 2 == 0) {
                         /* Add Border */
                         $page->setFillColor(new Zend_Pdf_Color_Rgb(255, 255, 255));
                         $page->setLineColor(new Zend_Pdf_Color_Html(Mage::helper('rewardpointsreferfriends')->getPdfStyleColor()));
                         $page->setLineWidth(0.5);
                         $page->setLineDashingPattern(array(3, 2, 3, 4), 1.6);
                         //                            $page->drawRectangle(310, $this->y, 560, $this->y - 170);
                         /* Insert Background image */
                         $store = Mage::app()->getStore($couponOffer->getStoreId());
                         $background_image = Mage::helper('rewardpointsreferfriends')->getBackgroundImg($store->getId());
                         if ($background_image) {
                             $background_image = Mage::getBaseDir('media') . DS . 'rewardpointsreferfriends/pdf/background/' . $background_image;
                             if (is_file($background_image)) {
                                 $background_image = Zend_Pdf_Image::imageWithPath($background_image);
                                 $page->drawImage($background_image, 310, $this->y - 170, 560, $this->y);
                             }
                         } else {
                             $background_image = Mage::getBaseDir('media') . DS . 'rewardpointsreferfriends/pdf/background/default/background.jpg';
                             if (is_file($background_image)) {
                                 $background_image = Zend_Pdf_Image::imageWithPath($background_image);
                                 $page->drawImage($background_image, 310, $this->y - 170, 560, $this->y);
                             }
                         }
                         /* Insert Image Logo */
                         $store = Mage::app()->getStore($couponOffer->getStoreId());
                         $image = Mage::getStoreConfig('rewardpoints/referfriendplugin/logo', $store->getId());
                         if ($image) {
                             $image = Mage::getBaseDir('media') . DS . 'rewardpointsreferfriends/pdf/logo/' . $image;
                             if (is_file($image)) {
                                 $image = Zend_Pdf_Image::imageWithPath($image);
                                 $page->drawImage($image, 320, $this->y - 79, 395, $this->y - 59);
                             }
                         } else {
                             $image = Mage::getBaseDir('media') . DS . 'rewardpointsreferfriends/pdf/logo/default/logo_print.png';
                             if (is_file($image)) {
                                 $image = Zend_Pdf_Image::imageWithPath($image);
                                 $page->drawImage($image, 320, $this->y - 79, 395, $this->y - 59);
                             }
                         }
                         //                        Insert discount
                         $page->setFillColor(new Zend_Pdf_Color_Html('#FF0000'));
                         $font = $this->_setFontBold($page, 40);
                         $special_offer = $this->getOfferDiscount();
                         $default_offer = $this->getDefaultDiscount();
                         if ($special_offer) {
                             $page->drawText($special_offer, 470, $this->y - 70, 'UTF-8');
                         } else {
                             if ($default_offer) {
                                 $page->drawText($default_offer, 470, $this->y - 70, 'UTF-8');
                             }
                         }
                         //                        Insert coupon id
                         //                            $page->setFillColor(new Zend_Pdf_Color_Html('#000000'));
                         //                            $this->_setFontBold($page, 10);
                         //                            $page->drawText(Mage::helper('rewardpointsreferfriends')->__('No: ' . $couponOffer->getId()), 340, $this->y - 85, 'UTF-8');
                         /* Insert caption */
                         $page->setFillColor(new Zend_Pdf_Color_Html(Mage::helper('rewardpointsreferfriends')->getPdfStyleColor()));
                         $this->_setFontBold($page, 14);
                         $page->drawText(Mage::helper('rewardpointsreferfriends')->getCaptionCoupon(), 470, $this->y - 30, 'UTF-8');
                         /* Coupon code */
                         $page->setFillColor(new Zend_Pdf_Color_Html(Mage::helper('rewardpointsreferfriends')->getBackgroundCoupon()));
                         $page->setLineColor(new Zend_Pdf_Color_Html(Mage::helper('rewardpointsreferfriends')->getBackgroundCoupon()));
                         $page->setLineDashingPattern();
                         $page->setLineWidth(0);
                         $page->drawRectangle(320, $this->y - 90, 550, $this->y - 115);
                         $page->setFillColor(new Zend_Pdf_Color_Html(Mage::helper('rewardpointsreferfriends')->getPdfCouponColor()));
                         $font = $this->_setFontBold($page, 14);
                         $page->drawText($couponOffer->getCoupon(), 770 / 2 - $this->getTextWidth($couponOffer->getCoupon(), $font, 14) / 2, $this->y - 108, 'UTF-8');
                         //                    /* NOTE */
                         //                        $page->setFillColor(new Zend_Pdf_Color_Html('#000000'));
                         //                        $this->_setFontBold($page, 8);
                         //                        $page->drawText(Mage::helper('rewardpointsreferfriends')->__('Notes: '), 85, $this->y - 175, 'UTF-8');
                         $page->setFillColor(new Zend_Pdf_Color_Html('#000000'));
                         $font = $this->_setFontItalic($page, 8);
                         $notes = $this->getPrintNotes($couponOffer, $font, 230);
                         $drawY = $this->y - 130;
                         foreach ($notes as $note) {
                             if ($note != '') {
                                 $this->_printHyperLink($page, $note, 320, $drawY);
                                 //                                    $page->drawText($note, 70, $drawY, 'UTF-8');
                                 $drawY -= 9;
                             }
//.........这里部分代码省略.........
开发者ID:sshegde123,项目名称:wmp8,代码行数:101,代码来源:Couponcode.php

示例14: pdfdisplayAction

 public function pdfdisplayAction()
 {
     $date1 = $this->_request->getParam('date1');
     $date2 = $this->_request->getParam('date2');
     $glsubcode = $this->_request->getParam('ledger');
     $pdf = new Zend_Pdf();
     $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
     $pdf->pages[] = $page;
     $app = $this->view->baseUrl();
     $word = explode('/', $app);
     $projname = $word[1];
     //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 horizontal
     //set the font
     $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 8);
     $this->view->search = 10;
     $generalLedger = new Generalledger_Model_Generalledger();
     //Lia
     $this->view->ledegerList = $generalLedger->generalLedger($date1, $date2, $glsubcode);
     $openingCash = $generalLedger->openingBalance($date1, $glsubcode);
     print_r($openingCash);
     //             // Assets
     $this->view->ledegerListAssets = $generalLedger->generalLedgerAssets($date1, $date2, $glsubcode);
     $this->view->openingCashAssets = $generalLedger->openingBalanceAssets($date1, $glsubcode);
     if (!$this->view->ledegerListAssets && !$this->view->openingCashAssets) {
     } else {
         $this->view->search = 0;
         echo "<font color='red'><b> Record not found</b> </font>";
     }
     if (count($openingCash)) {
         foreach ($openingCash as $openingCash) {
             if ($openingCash["glsubcode_id"] == $ledegerList["glsubcode_id"]) {
                 $liabilityCash = $openingCash["openingCash"];
             }
         }
     }
     $text = array("Particular", "debit", "credit", "balance", "Opening balance");
     $x0 = 60;
     $x1 = 200;
     $x2 = 340;
     $x3 = 480;
     $page->drawLine(50, 740, 550, 740);
     $page->drawLine(50, 720, 550, 720);
     $page->drawText($text[0], $x0, 725);
     $page->drawText($text[1], $x1, 725);
     $page->drawText($text[2], $x2, 725);
     $page->drawText($text[3], $x3, 725);
     $page->drawText($text[4], $x0, 700);
     foreach ($openingCash as $openingCash) {
         $page->drawText($openingCash["openingCash"], $x3, 700);
     }
     $y1 = 725;
     //$page->drawText(Opening balance,$x0, $y1);
     $pdf->save('/var/www/' . $projname . '/reports/GL.pdf');
     $path = '/var/www/' . $projname . '/reports/GL.pdf';
     // $pdf->save('/var/www/ourbank/reports/GL.pdf');
     // $path = '/var/www/ourbank/reports/GL.pdf';
     chmod($path, 0777);
 }
开发者ID:maniargaurav,项目名称:OurBank,代码行数:70,代码来源:IndexController.php

示例15: array_reverse

//------------------------------------------------------------------------------------
// Reverse page order
$pdf->pages = array_reverse($pdf->pages);

// Create new Style
$style = new Zend_Pdf_Style();
$style->setFillColor(new Zend_Pdf_Color_Rgb(0, 0, 0.9));
$style->setLineColor(new Zend_Pdf_Color_GrayScale(0.2));
$style->setLineWidth(3);
$style->setLineDashingPattern(array(3, 2, 3, 4), 1.6);
$style->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA_BOLD), 32);

try {
    // Create new image object
    require_once 'Zend/Pdf/Image.php';
    $stampImage = Zend_Pdf_Image::imageWithPath(__DIR__ . '/stamp.jpg');
} catch (Zend_Pdf_Exception $e) {
    // Example of operating with image loading exceptions.
    if ($e->getMessage() != 'Image extension is not installed.' &&
        $e->getMessage() != 'JPG support is not configured properly.') {
        throw $e;
    }
    $stampImage = null;
}

// Mark page as modified
foreach ($pdf->pages as $page){
    $page->saveGS()
         ->setAlpha(0.25)
         ->setStyle($style)
         ->rotate(0, 0, M_PI_2/3);
开发者ID:necrogami,项目名称:zf2,代码行数:31,代码来源:demo.php


注:本文中的Zend_Pdf_Image类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。