本文整理汇总了PHP中Zend_Pdf::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Pdf::render方法的具体用法?PHP Zend_Pdf::render怎么用?PHP Zend_Pdf::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Pdf
的用法示例。
在下文中一共展示了Zend_Pdf::render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPdf
/**
* Creates a PDF report from the Minutes model given.
* Returns the PDF as a string that can either be saved to disk
* or streamed back to the browser.
*
* @param Phprojekt_Model_Interface $minutesModel The minutes model object to create the PDF from.
*
* @return string The resulting PDF document.
*/
public static function getPdf(Phprojekt_Model_Interface $minutesModel)
{
$phpr = Phprojekt::getInstance();
$pdf = new Zend_Pdf();
$page = new Phprojekt_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
$pages = array($page);
$page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 12);
$page->setBorder(2.0 * Phprojekt_Pdf_Page::PT_PER_CM, 2.0 * Phprojekt_Pdf_Page::PT_PER_CM, 2.0 * Phprojekt_Pdf_Page::PT_PER_CM, 3.0 * Phprojekt_Pdf_Page::PT_PER_CM);
$page->addFreetext(array('lines' => $minutesModel->title, 'fontSize' => 20));
$page->addFreetext(array('lines' => array_merge(explode("\n\n", $minutesModel->description), array($phpr->translate('Start') . ': ' . $minutesModel->meetingDatetime, $phpr->translate('End') . ': ' . $minutesModel->endTime, $phpr->translate('Place') . ': ' . $minutesModel->place, $phpr->translate('Moderator') . ': ' . $minutesModel->moderator)), 'fontSize' => 12));
$invited = Minutes_Helpers_Userlist::expandIdList($minutesModel->participantsInvited);
$attending = Minutes_Helpers_Userlist::expandIdList($minutesModel->participantsAttending);
$excused = Minutes_Helpers_Userlist::expandIdList($minutesModel->participantsExcused);
$pages += $page->addTable(array('fontSize' => 12, 'rows' => array(array(array('text' => $phpr->translate('Invited'), 'width' => 4.7 * Phprojekt_Pdf_Page::PT_PER_CM), array('text' => array_reduce($invited, array('self', '_concat')), 'width' => 12.0 * Phprojekt_Pdf_Page::PT_PER_CM)), array(array('text' => $phpr->translate('Attending'), 'width' => 4.7 * Phprojekt_Pdf_Page::PT_PER_CM), array('text' => array_reduce($attending, array('self', '_concat')), 'width' => 12.0 * Phprojekt_Pdf_Page::PT_PER_CM)), array(array('text' => $phpr->translate('Excused'), 'width' => 4.7 * Phprojekt_Pdf_Page::PT_PER_CM), array('text' => array_reduce($excused, array('self', '_concat')), 'width' => 12.0 * Phprojekt_Pdf_Page::PT_PER_CM)))));
$page = end($pages);
$itemtable = array();
$items = $minutesModel->items->fetchAll();
foreach ($items as $item) {
$itemtable[] = array(array('text' => $item->topicId, 'width' => 1.3 * Phprojekt_Pdf_Page::PT_PER_CM), array('text' => $phpr->translate($item->information->getTopicType($item->topicType)), 'width' => 3.0 * Phprojekt_Pdf_Page::PT_PER_CM), array('text' => $item->getDisplay(), 'width' => 12.4 * Phprojekt_Pdf_Page::PT_PER_CM));
}
$pages += $page->addTable(array('fontSize' => 12, 'rows' => array_merge(array(array('isHeader' => true, array('text' => $phpr->translate('No.'), 'width' => 1.3 * Phprojekt_Pdf_Page::PT_PER_CM), array('text' => $phpr->translate('Type'), 'width' => 3.0 * Phprojekt_Pdf_Page::PT_PER_CM), array('text' => $phpr->translate('Item'), 'width' => 12.4 * Phprojekt_Pdf_Page::PT_PER_CM))), $itemtable)));
$page = end($pages);
$pdf->pages = $pages;
$pdf->properties['Title'] = $minutesModel->title;
$owner = Minutes_Helpers_Userlist::expandIdList($minutesModel->ownerId);
$pdf->properties['Author'] = $owner[0]['display'];
$pdf->properties['Producer'] = 'PHProjekt version ' . Phprojekt::getVersion();
$pdf->properties['CreationDate'] = 'D:' . gmdate('YmdHis');
$pdf->properties['Keywords'] = $minutesModel->description;
return $pdf->render();
}
示例2: execute
/**
* Print label for one specific shipment
*
* @return ResponseInterface|void
*/
public function execute()
{
try {
$this->shipmentLoader->setOrderId($this->getRequest()->getParam('order_id'));
$this->shipmentLoader->setShipmentId($this->getRequest()->getParam('shipment_id'));
$this->shipmentLoader->setShipment($this->getRequest()->getParam('shipment'));
$this->shipmentLoader->setTracking($this->getRequest()->getParam('tracking'));
$shipment = $this->shipmentLoader->load();
$labelContent = $shipment->getShippingLabel();
if ($labelContent) {
$pdfContent = null;
if (stripos($labelContent, '%PDF-') !== false) {
$pdfContent = $labelContent;
} else {
$pdf = new \Zend_Pdf();
$page = $this->labelGenerator->createPdfPageFromImageString($labelContent);
if (!$page) {
$this->messageManager->addError(__('We don\'t recognize or support the file extension in this shipment: %1.', $shipment->getIncrementId()));
}
$pdf->pages[] = $page;
$pdfContent = $pdf->render();
}
return $this->_fileFactory->create('ShippingLabel(' . $shipment->getIncrementId() . ').pdf', $pdfContent, DirectoryList::VAR_DIR, 'application/pdf');
}
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
} catch (\Exception $e) {
$this->_objectManager->get('Psr\\Log\\LoggerInterface')->critical($e);
$this->messageManager->addError(__('An error occurred while creating shipping label.'));
}
$this->_redirect('adminhtml/order_shipment/view', ['shipment_id' => $this->getRequest()->getParam('shipment_id')]);
}
示例3: testProcessing
public function testProcessing()
{
$pdf = new Zend_Pdf();
$page1 = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
$page2 = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
$page3 = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
// not actually included into pages array
$pdf->pages[] = $page1;
$pdf->pages[] = $page2;
$this->assertTrue(count($pdf->getNamedDestinations()) == 0);
// require_once 'Zend/Pdf/Destination/Fit.php';
$destination1 = Zend_Pdf_Destination_Fit::create($page1);
$destination2 = Zend_Pdf_Destination_Fit::create($page2);
$action1 = Zend_Pdf_Action_GoTo::create($destination1);
$pdf->setNamedDestination('GoToPage1', $action1);
$this->assertTrue($pdf->getNamedDestination('GoToPage1') === $action1);
$this->assertTrue($pdf->getNamedDestination('GoToPage9') === null);
$pdf->setNamedDestination('Page2', $destination2);
$this->assertTrue($pdf->getNamedDestination('Page2') === $destination2);
$this->assertTrue($pdf->getNamedDestination('Page9') === null);
$pdf->setNamedDestination('Page1', $destination1);
$pdf->setNamedDestination('Page1_1', Zend_Pdf_Destination_Fit::create(1));
$pdf->setNamedDestination('Page9_1', Zend_Pdf_Destination_Fit::create(9));
// will be egnored
$action3 = Zend_Pdf_Action_GoTo::create(Zend_Pdf_Destination_Fit::create($page3));
$pdf->setNamedDestination('GoToPage3', $action3);
$this->assertTrue(strpos($pdf->render(), '[(GoToPage1) <</Type /Action /S /GoTo /D [3 0 R /Fit ] >> (Page1) [3 0 R /Fit ] (Page1_1) [1 /Fit ] (Page2) [4 0 R /Fit ] ]') !== false);
}
示例4: render
public function render()
{
$page = $this->newPage();
$this->createHeader($page);
$this->createContent($page);
$this->createFooter($page);
$this->_pdf->pages[] = $page;
return $this->_pdf->render();
}
示例5: getPdf
public function getPdf()
{
$pdf = new Zend_Pdf();
$page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES);
$page->setFont($font, 12);
$width = $page->getWidth();
$i = 0;
$this->insertLogo($page);
$this->insertAddress($page);
/*$page->setFillColor(new Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92));
$page->drawRectangle(25, $this->y + 15, 190, $this->y - 35);
$page->drawRectangle(190, $this->y + 15, 350, $this->y - 35);
$page->drawRectangle(350, $this->y + 15, 570, $this->y - 35);*/
$page->setFont($font, 16);
$this->y -= 50;
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0.5));
$page->drawRectangle(25, $this->y + 15, 573, $this->y - 57);
$page->setFillColor(new Zend_Pdf_Color_Html('#ffffff'));
$headerText = "Report: Net Sales & Tax";
$page->drawText($headerText, 30, $this->y, 'UTF-8');
$this->y -= 22;
$page->drawText("From: " . $this->from, 30, $this->y, 'UTF-8');
$this->y -= 22;
$page->drawText("To: " . $this->to, 30, $this->y, 'UTF-8');
$page->setFont($font, 14);
$this->y -= 50;
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
$totalText = Mage::helper('sales')->__('Total Net Sale');
$page->drawText($totalText, 25, $this->y, 'UTF-8');
$total = Mage::helper('core')->currency($this->getTotalSale(), true, false);
$page->drawText($total, 505, $this->y, 'UTF-8');
$this->y -= 50;
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
$totalText = Mage::helper('sales')->__('Net Sales Texas Only');
$page->drawText($totalText, 25, $this->y, 'UTF-8');
$total = Mage::helper('core')->currency($this->getTotalTexasSale(), true, false);
$page->drawText($total, 505, $this->y, 'UTF-8');
$this->y -= 50;
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
$totalText = Mage::helper('sales')->__('Net Shipping Costs for Texas only');
$page->drawText($totalText, 25, $this->y, 'UTF-8');
$total = Mage::helper('core')->currency($this->getTotalTexasShipping(), true, false);
$page->drawText($total, 505, $this->y, 'UTF-8');
$this->y -= 50;
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
$totalText = Mage::helper('sales')->__('Texas Net Sales Tax');
$page->drawText($totalText, 25, $this->y, 'UTF-8');
$total = Mage::helper('core')->currency($this->getTotalTexasTax(), true, false);
$page->drawText($total, 505, $this->y, 'UTF-8');
$pdf->pages[] = $page;
return $pdf->render();
}
示例6: render
/**
* Create Label
*
* @return string
* @throws Zend_Pdf_Exception
* @throws InvalidArgumentException
*/
public function render()
{
$pdf = new Zend_Pdf();
$pdfBuilder = new Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder();
$template = new Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page(Zend_Pdf_Page::SIZE_A4_LANDSCAPE);
$pdfBuilder->setPage($template)->addProductName((string) $this->_info->ProductShortName)->addProductContentCode((string) $this->_info->ProductContentCode)->addSenderInfo($this->_info->Shipper)->addOriginInfo((string) $this->_info->OriginServiceArea->ServiceAreaCode)->addReceiveInfo($this->_info->Consignee)->addDestinationFacilityCode((string) $this->_info->Consignee->CountryCode, (string) $this->_info->DestinationServiceArea->ServiceAreaCode, (string) $this->_info->DestinationServiceArea->FacilityCode)->addServiceFeaturesCodes()->addDeliveryDateCode()->addShipmentInformation($this->_request->getOrderShipment())->addDateInfo($this->_info->ShipmentDate)->addWeightInfo((string) $this->_info->ChargeableWeight, (string) $this->_info->WeightUnit)->addWaybillBarcode((string) $this->_info->AirwayBillNumber, (string) $this->_info->Barcodes->AWBBarCode)->addRoutingBarcode((string) $this->_info->DHLRoutingCode, (string) $this->_info->DHLRoutingDataId, (string) $this->_info->Barcodes->DHLRoutingBarCode)->addBorder();
$packages = array_values($this->_request->getPackages());
$i = 0;
foreach ($this->_info->Pieces->Piece as $piece) {
$page = new Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page($template);
$pdfBuilder->setPage($page)->addPieceNumber((int) $piece->PieceNumber, (int) $this->_info->Piece)->addContentInfo($packages[$i])->addPieceIdBarcode((string) $piece->DataIdentifier, (string) $piece->LicensePlate, (string) $piece->LicensePlateBarCode);
array_push($pdf->pages, $page);
$i++;
}
return $pdf->render();
}
示例7: pdfAction
//.........这里部分代码省略.........
$shgdeclaration = " SHG I hereby declare and confirm further that I have not committed any default in paying the lease amount to the lesser and have not committed any breach of the terms and conditions of the lease.Moreover,I declare further that there are no arrears of any lease amount.\n\nI have also not resorted to outside borrowing against security of the present crop which is the subject matter of the bank finance.The crop to be raised is free from the charge/encumbrances.";
$jlgdeclaration = " JLG I hereby declare and confirm further that I have not committed any default in paying the lease amount to the lesser and have not committed any breach of the terms and conditions of the lease.Moreover,I declare further that there are no arrears of any lease amount.\n\nI have also not resorted to outside borrowing against security of the present crop which is the subject matter of the bank finance.The crop to be raised is free from the charge/encumbrances.";
$pdf = new Zend_Pdf();
foreach ($this->view->memberdetails as $memberdetails) {
$page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
$pdf->pages[] = $page;
//Path
$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, 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), 10);
$title = "";
if (substr($this->view->groupcode, 4, 1) == 2) {
$title = "Self Helf Group member";
} else {
if (substr($this->view->groupcode, 4, 1) == 3) {
$title = "Joint Liability Group member";
}
}
$page->drawText($title, 230, 740);
$page->drawText($title, 230, 740);
//set the font
$page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 8);
$page->drawText("Date : " . date('d-m-Y'), 500, 800);
$y1 = 710;
$y2 = 740;
$x1 = 60;
$x2 = 350;
$x3 = 230;
$x4 = 400;
if ($y1 > 45) {
$page->drawText("To,", $x1, $y1);
$page->drawText("The Branch manager,", $x1, $y1 = $y1 - 15);
$page->drawText($this->view->bankdetails[0]['bankname'] . ',', $x1, $y1 = $y1 - 15);
$page->drawText($this->view->bankdetails[0]['branch'] . '.', $x1, $y1 = $y1 - 15);
$page->drawText('Respected sir,', $x1, $y1 = $y1 - 35);
if ($memberdetails['alias']) {
$alias = "@ " . $memberdetails['alias'];
} else {
$alias = '';
}
$village = $this->view->Dbobj->fetchvillagedetails($memberdetails['village_id']);
$subject = $memberdetails['membername'] . " " . $alias . " " . $memberdetails['age'] . " Age " . $this->view->groupdetails[0]['group_name'] . " Group " . $village[0]['villagename'] . " Village " . $village[0]['talukname'] . " Taluk " . $village[0]['distname'] . " District.";
$page->drawText($subject, $x1, $y1 = $y1 - 25);
$y1 = $y1 - 25;
$addressline = 0;
if (substr($this->view->groupcode, 4, 1) == 2) {
$newtext = wordwrap($shgdeclaration, 30, "<br />");
$pieces = explode("<br />", $newtext);
$page->drawText($pieces, $x1, $y1);
} else {
if (substr($this->view->groupcode, 4, 1) == 3) {
$newtext = wordwrap($jlgdeclaration, 130, "<br />");
$pieces = explode("<br />", $newtext);
foreach ($pieces as $pieces1) {
$page->drawText(substr($pieces1, 0, 300), $x1, $y1);
$y1 -= 15;
$addressline++;
}
$y1 -= $addressline * 15;
// $page->drawText($pieces,$x1, $y1);
}
}
$y1 = $y1 - 35;
$page->drawText("Date :" . $this->view->groupdetails[0]['group_created_date'], $x1, $y1);
$page->drawText("yours obediently,", $x2, $y1);
$page->drawText("Place :" . $this->view->groupdetails[0]['place'], $x1, $y1 = $y1 - 15);
$y1 = $y1 - 35;
$page->drawText($memberdetails['membername'], $x2, $y1);
$page->drawText("Signature", $x2, $y1 = $y1 - 15);
$y1 = $y1 - 45;
$page->drawText("Representative Seal & signature", $x1, $y1);
$y1 = $y1 - 25;
$page->drawText("Representative 1", $x1, $y1);
$page->drawText("Representative 2", $x3, $y1);
$page->drawText("Representative 3", $x4, $y1);
$y1 = $y1 - 15;
foreach ($this->view->representative as $representative) {
$page->drawText($representative['membername'], $x1, $y1);
$x1 = $x1 + 170;
}
}
}
$pdfData = $pdf->render();
$pdf->save('/var/www/' . $projname . '/reports/membersdeclaration.pdf');
$path = '/var/www/' . $projname . '/reports/membersdeclaration.pdf';
chmod($path, 0777);
}
示例8: printLabelAction
/**
* Print label for one specific shipment
*
*/
public function printLabelAction()
{
try {
$shipment = $this->_initShipment();
$labelContent = $shipment->getShippingLabel();
if ($labelContent) {
$pdfContent = null;
if (stripos($labelContent, '%PDF-') !== false) {
$pdfContent = $labelContent;
} else {
$pdf = new Zend_Pdf();
$page = $this->_createPdfPageFromImageString($labelContent);
if (!$page) {
$this->_getSession()->addError(Mage::helper('sales')->__('File extension not known or unsupported type in the following shipment: %s', $shipment->getIncrementId()));
}
$pdf->pages[] = $page;
$pdfContent = $pdf->render();
}
return $this->_prepareDownloadResponse('ShippingLabel(' . $shipment->getIncrementId() . ').pdf', $pdfContent, 'application/pdf');
}
} catch (Mage_Core_Exception $e) {
$this->_getSession()->addError($e->getMessage());
} catch (Exception $e) {
Mage::logException($e);
$this->_getSession()->addError(Mage::helper('sales')->__('An error occurred while creating shipping label.'));
}
$this->_redirect('*/sales_order_shipment/view', array('shipment_id' => $this->getRequest()->getParam('shipment_id')));
}
示例9: pdfgenerationAction
function pdfgenerationAction()
{
$declarationform = new Declaration_Form_Account();
$this->view->form = $declarationform;
$this->view->membercode = $memcode = $this->_request->getParam('membercode');
if (substr($memcode, 4, 1) == 2 or substr($memcode, 4, 1) == 3) {
$this->view->groupresult = $result = $this->view->dbobj->getmembers($memcode);
//
if ($result) {
$declarationform->populate($result[0]);
$this->view->groupcode = $groupcode = $result[0]['groupcode'];
$this->view->relation = $result = $this->view->dbobj->getrelations($groupcode);
}
} else {
$this->view->result = $result = $this->view->dbobj->getmember($memcode);
//
if ($result) {
$declarationform->populate($result[0]);
$this->view->membercode1 = $familyid = $result[0]['family_id'];
$this->view->relation = $result = $this->view->dbobj->getrelation($familyid);
$dbobj = new Declaration_Model_Dec();
$app = $this->view->baseUrl();
$word = explode('/', $app);
$projname = $word[1];
$title1 = "declaration";
$this->view->pageTitle = $title1;
$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);
$Declaration = new Declaration_Model_Dec();
$memcode = $this->_request->getParam('membercode');
$familyid = $this->_request->getParam('membercode1');
$showgetmember = $Declaration->getmember($memcode);
$showgetrelation = $Declaration->getrelation($familyid);
$dateconvert = new App_Model_dateConvertor();
foreach ($this->view->result as $result) {
}
// write text to page
$page->setFont($font, 12)->drawText('DECLARATION', 240, 720);
// $page->setLineWidth(1)->drawLine(0, 800, 820, 250);
$page->setFont($font, 10)->drawText('(TO BE SUBMITTED BY THE BORROWER UNDER SBI JOINT LIABILITY GROUP)', 72, 700);
$page->setFont($font, 9)->drawText('I,' . $result['name'] . ' (Name of the borrower), Son of ' . $this->view->relation[0]['fathername'] . '', 72, 670);
$page->setFont($font, 9)->drawText('Aged around ' . $result['age'] . ' years,presently residing at ' . $result['street'] . ' do here by', 72, 655);
$page->setFont($font, 9)->drawText('Solemnly affirm and sincerely state on Oath as follows:', 72, 625);
$page->setFont($font, 9)->drawText('i) I propose to avail a crop loan under SBI JLG scheme against hypothecation of the crop which the loan is to be sanctioned.', 72, 605);
$page->setFont($font, 9)->drawText('ii) In this connection, I confirm that and declare that I am land less labourer / share cropper /tenant farmer /oral lessee', 72, 585);
$page->setFont($font, 9)->drawText('( Stricke out which ever not applicable ).', 80, 575);
$page->setFont($font, 9)->drawText('iii) I hereby declare and confirm furture that the properties mentioned in the schedule to the affidavit is the property which', 72, 555);
$page->setFont($font, 9)->drawText('is the subject matter of lease (Oral /written) in my favour for year to year or for period of ' . $dateconvert->normalformat($result['created_date']) . '', 80, 545);
$page->setFont($font, 9)->drawText('year as mentioned in the document and the lease is presently in force and Sri ' . $result['landowner_name'] . ' is the lesser and ', 80, 535);
$page->setFont($font, 9)->drawText('the owner of the property (a copy of the lease deed is enclosed).', 80, 525);
$page->setFont($font, 9)->drawText('iv)I hereby declare and confirm further that I have not committed any default in paying the lease amount to the lesser and', 72, 505);
$page->setFont($font, 9)->drawText('have not committed any breach of the terms and conditions of the lease.Moreover,I declare further that there are no', 80, 495);
$page->setFont($font, 9)->drawText('arrears of any lease amount.', 80, 485);
$page->setFont($font, 9)->drawText('v) I have also not resorted to outside borrowing against security of the present crop which is the subject matter of the bank', 72, 465);
$page->setFont($font, 9)->drawText('finance.The crop to be raised is free from the charge/encumbrances.', 80, 455);
// add page to document
$pdf->pages[] = $page;
$pdfData = $pdf->render();
$pdfData = $pdf->render();
$pdf->save('/var/www/' . $projname . '/reports/declaration.pdf');
$path = '/var/www/' . $projname . '/reports/declaration.pdf';
chmod($path, 0777);
// $this->_redirect('/declaration/index');
}
}
}
示例10: 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');
}
示例11: printLabelAction
/**
* Print label for one specific shipment
*/
public function printLabelAction()
{
try {
$data = Mage::helper('enterprise_rma')->decodeTrackingHash($this->getRequest()->getParam('hash'));
$rmaIncrementId = '';
if ($data['key'] == 'rma_id') {
$this->_loadValidRma($data['id']);
if (Mage::registry('current_rma')) {
$rmaIncrementId = Mage::registry('current_rma')->getIncrementId();
}
}
$model = Mage::getModel('enterprise_rma/shipping_info')->loadPackage($this->getRequest()->getParam('hash'));
$shipping = Mage::getModel('enterprise_rma/shipping');
$labelContent = $model->getShippingLabel();
if ($labelContent) {
$pdfContent = null;
if (stripos($labelContent, '%PDF-') !== false) {
$pdfContent = $labelContent;
} else {
$pdf = new Zend_Pdf();
$page = $shipping->createPdfPageFromImageString($labelContent);
if (!$page) {
$this->_getSession()->addError(Mage::helper('sales')->__('File extension not known or unsupported type in the following shipment: %s', $shipment->getIncrementId()));
}
$pdf->pages[] = $page;
$pdfContent = $pdf->render();
}
return $this->_prepareDownloadResponse('ShippingLabel(' . $rmaIncrementId . ').pdf', $pdfContent, 'application/pdf');
}
} catch (Mage_Core_Exception $e) {
$this->_getSession()->addError($e->getMessage());
} catch (Exception $e) {
Mage::logException($e);
$this->_getSession()->addError(Mage::helper('sales')->__('An error occurred while creating shipping label.'));
}
$this->norouteAction();
return;
}
示例12: render
/**
* Draw the barcode in the PDF, send headers and the PDF
* @return mixed
*/
public function render()
{
$this->draw();
header("Content-Type: application/pdf");
echo $this->_resource->render();
}
示例13: pdfAction
//.........这里部分代码省略.........
//$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);
$page->setFont($font, 10)->drawText($original_deposit_id, 648, 385);
$page->setFont($font, 10)->drawText($customername, 140, 323);
//$page->setFont($font,10)->drawText('HSR Layout, Bangalore',470,267);
$page->setFont($font, 10)->drawText($dd_no, 97, 276);
$page->setFont($font, 10)->drawText($dd_date, 220, 276);
$page->setFont($font, 10)->drawText($draweenamedd, 280, 276);
$page->setFont($font, 10)->drawText($draweebankdd, 425, 276);
$page->setFont($font, 10)->drawText($order_ic_id, 570, 276);
$page->setFont($font, 10)->drawText('Rs. ' . $grandtotal, 685, 276);
$page->setFont($font, 10)->drawText('Rs. ' . $total, 683, 178);
}
if ($payment_method_code == 'cheque_checkout') {
$image = Zend_Pdf_Image::imageWithPath('skin/frontend/default/msupply/images/pdf/cheque.jpg');
$page->drawImage($image, 50, 100, 772, 496);
$page->setFont($font, 10)->drawText($companyname, 152, 418);
$page->setFont($font, 10)->drawText($clientcode, 135, 353);
$page->setFont($font, 10)->drawText($local, 125, 385);
$page->setFont($font, 10)->drawText($out, 368, 385);
$page->setFont($font, 10)->drawText($currentdate, 322, 353);
$page->setFont($font, 10)->drawText($original_deposit_id, 630, 385);
$page->setFont($font, 10)->drawText($customername, 155, 322);
$page->setFont($font, 10)->drawText($checkno, 110, 276);
$page->setFont($font, 10)->drawText($chqdate, 230, 276);
$page->setFont($font, 10)->drawText($draweename, 300, 276);
$page->setFont($font, 10)->drawText($draweebank, 430, 276);
$page->setFont($font, 10)->drawText($order_ic_id, 560, 276);
$page->setFont($font, 10)->drawText('Rs. ' . $grandtotal, 675, 276);
$page->setFont($font, 10)->drawText('Rs. ' . $total, 675, 178);
}
if ($payment_method_code == 'cashin') {
$image = Zend_Pdf_Image::imageWithPath('skin/frontend/default/msupply/images/pdf/cashin.jpg');
$page->drawImage($image, 50, 100, 772, 496);
$page->setFont($font, 10)->drawText($companyname, 165, 418);
$page->setFont($font, 10)->drawText($clientcode, 148, 355);
//$page->setFont($font,10)->drawText($localchq,160,368);
$page->setFont($font, 10)->drawText($currentdate, 326, 355);
$page->setFont($font, 10)->drawText($original_deposit_id, 580, 386);
$page->setFont($font, 10)->drawText($customername, 173, 323);
$page->setFont($font, 10)->drawText($order_ic_id, 645, 276);
$page->setFont($font, 10)->drawText('Rs. ' . $total, 535, 160);
}
$pdfData = $pdf->render();
$fileName = $order_ic_id . '.pdf';
$this->_prepareDownloadResponse($fileName, $pdfData);
}
示例14: createpdfAction
public function createpdfAction()
{
$this->render('index');
$idpdf = $this->getRequest()->getParam('idpdf');
$objeto_model = new Application_Model_Db();
if ($this->getRequest()->isPost()) {
$lab = $this->getRequest()->getPost('infoLab');
// $this->view->lab = $lab;
} else {
$lab = $this->getRequest()->getParam('infoLab');
}
try {
if ($lab) {
$valor = $objeto_model->selectDados($lab);
} else {
$valor = $objeto_model->selectAllDados();
}
$this->view->assign('valor', $valor);
} catch (Zend_Exception $e) {
echo $e;
}
if ($idpdf == 1) {
$client = new Zend_Http_Client();
// set some parameters
$client->setParameterGet('infoLab', 'bi');
$pdf = new Zend_Pdf();
$pdfPage = $pdf->newPage(Zend_Pdf_Page::SIZE_A4_LANDSCAPE);
// 595:842 A4
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_COURIER);
$pdfPage->setFont($font, 12);
$pdfPage->drawText('Local', 20, 570, 'UTF-8');
$pdfPage->drawText('Nome laboratório', 75, 570, 'UTF-8');
$pdfPage->drawText('Data', 205, 570, 'UTF-8');
$pdfPage->drawText('Turno visita', 265, 570, 'UTF-8');
$pdfPage->drawText('Somente aula?', 365, 570, 'UTF-8');
$pdfPage->drawText('Frequencia aula', 475, 570, 'UTF-8');
$pdfPage->drawText('Turno Aula', 595, 570, 'UTF-8');
$pdfPage->drawText('Quantidade gabinete', 695, 570, 'UTF-8');
$stringpos = 550;
// posicao x do meu texto
$stringdif = 12;
// diferença entre cada quebra de linha.
$pdfPage->setFont($font, 9);
foreach ($valor as $value) {
$pdfPage->drawText($stringpos, 20, $stringpos, 'UTF-8');
$pdfPage->drawText($value->nomeLaboratorio, 75, $stringpos, 'UTF-8');
$pdfPage->drawText($value->data, 205, $stringpos, 'UTF-8');
$pdfPage->drawText($value->turnoVisita, 265, $stringpos, 'UTF-8');
$pdfPage->drawText($value->somenteAula, 365, $stringpos, 'UTF-8');
$pdfPage->drawText($value->frequenciaAula, 475, $stringpos, 'UTF-8');
$pdfPage->drawText($value->turnoAula, 595, $stringpos, 'UTF-8');
$pdfPage->drawText($value->quantGabinete, 695, $stringpos, 'UTF-8');
$stringpos = $stringpos - $stringdif;
// subtrai para que a
// linha fique embaixo
}
if ($stringpos < 285) {
array_push($pdf->pages, $pdfPage);
$pdfPage = $pdf->newPage(Zend_Pdf_Page::SIZE_A4_LANDSCAPE);
$stringpos = 580;
}
$stringpos -= 4;
$pdfPage->setFont($font, 12);
$pdfPage->drawText('Quantidade tipo gabinete', 20, $stringpos, 'UTF-8');
$pdfPage->drawText('Sistema operacional', 205, $stringpos, 'UTF-8');
$pdfPage->drawText('Licença DTI?', 365, $stringpos, 'UTF-8');
$pdfPage->drawText('OCS instalado?', 475, $stringpos, 'UTF-8');
$pdfPage->drawText('Ips servidores', 595, $stringpos, 'UTF-8');
$pdfPage->drawText('Estrutura L.rede', 710, $stringpos, 'UTF-8');
$stringpos -= 12;
$pdfPage->setFont($font, 9);
foreach ($valor as $value) {
$pdfPage->drawText($stringpos, 20, $stringpos, 'UTF-8');
$pdfPage->drawText($value->sisOperacional, 205, $stringpos, 'UTF-8');
$pdfPage->drawText($value->licencaDti, 365, $stringpos, 'UTF-8');
$pdfPage->drawText($value->ocsInstalado, 475, $stringpos, 'UTF-8');
$pdfPage->drawText($value->ipsServidores, 595, $stringpos, 'UTF-8');
$pdfPage->drawText($value->estruturaLRede, 710, $stringpos, 'UTF-8');
$stringpos = $stringpos - $stringdif;
// subtrai para que a
// linha fique embaixo
}
if ($stringpos < 198) {
array_push($pdf->pages, $pdfPage);
$pdfPage = $pdf->newPage(Zend_Pdf_Page::SIZE_A4_LANDSCAPE);
$stringpos = 580;
}
$stringpos -= 4;
$pdfPage->setFont($font, 12);
$pdfPage->drawText('Roteador', 20, $stringpos, 'UTF-8');
$pdfPage->drawText('Ip entrada', 205, $stringpos, 'UTF-8');
$pdfPage->drawText('Ip saída', 365, $stringpos, 'UTF-8');
$pdfPage->drawText('Nome responsável', 475, $stringpos, 'UTF-8');
$pdfPage->drawText('Ramal', 595, $stringpos, 'UTF-8');
$pdfPage->drawText('E-mail', 715, $stringpos, 'UTF-8');
$stringpos -= 12;
$pdfPage->setFont($font, 9);
foreach ($valor as $value) {
$pdfPage->drawText($stringpos, 20, $stringpos, 'UTF-8');
$pdfPage->drawText($value->ipEntrada, 205, $stringpos, 'UTF-8');
//.........这里部分代码省略.........
示例15: echoPdf
/**
* Echos the pdf as output with the specified filename.
*
* When download is true the file is returned as a download link,
* otherwise the pdf is shown in the browser.
*
* @param \Zend_Pdf $pdf
* @param string $filename
* @param boolean $download
* @param boolean $exit Should the application stop running after output
*/
protected function echoPdf(\Zend_Pdf $pdf, $filename, $download = false, $exit = true)
{
$content = $pdf->render();
$this->echoPdfContent($content, $filename, $download);
if ($exit) {
// No further output
exit;
}
}