CC-2166: Packaging Improvements. Moved the Zend app into airtime_mvc. It is now installed to /var/www/airtime. Storage is now set to /srv/airtime/stor. Utils are now installed to /usr/lib/airtime/utils/. Added install/airtime-dircheck.php as a simple test to see if everything is install/uninstalled correctly.

This commit is contained in:
Paul Baranowski 2011-04-14 18:55:04 -04:00
parent 514777e8d2
commit b11cbd8159
4546 changed files with 138 additions and 51 deletions

View file

@ -0,0 +1,122 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Explicit.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element.php';
/** Zend_Pdf_Destination */
require_once 'Zend/Pdf/Destination.php';
/**
* Abstract PDF explicit destination representation class
*
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Pdf_Destination_Explicit extends Zend_Pdf_Destination
{
/**
* Destination description array
*
* @var Zend_Pdf_Element_Array
*/
protected $_destinationArray;
/**
* True if it's a remote destination
*
* @var boolean
*/
protected $_isRemote;
/**
* Explicit destination object constructor
*
* @param Zend_Pdf_Element $destinationArray
* @throws Zend_Pdf_Exception
*/
public function __construct(Zend_Pdf_Element $destinationArray)
{
if ($destinationArray->getType() != Zend_Pdf_Element::TYPE_ARRAY) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Explicit destination resource Array must be a direct or an indirect array object.');
}
$this->_destinationArray = $destinationArray;
switch (count($this->_destinationArray->items)) {
case 0:
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Destination array must contain a page reference.');
break;
case 1:
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Destination array must contain a destination type name.');
break;
default:
// Do nothing
break;
}
switch ($this->_destinationArray->items[0]->getType()) {
case Zend_Pdf_Element::TYPE_NUMERIC:
$this->_isRemote = true;
break;
case Zend_Pdf_Element::TYPE_DICTIONARY:
$this->_isRemote = false;
break;
default:
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Destination target must be a page number or page dictionary object.');
break;
}
}
/**
* Returns true if it's a remote destination
*
* @return boolean
*/
public function isRemote()
{
return $this->_isRemote;
}
/**
* Get resource
*
* @internal
* @return Zend_Pdf_Element
*/
public function getResource()
{
return $this->_destinationArray;
}
}

View file

@ -0,0 +1,75 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Fit.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element/Array.php';
require_once 'Zend/Pdf/Element/Name.php';
require_once 'Zend/Pdf/Element/Numeric.php';
/** Zend_Pdf_Destination_Explicit */
require_once 'Zend/Pdf/Destination/Explicit.php';
/**
* Zend_Pdf_Destination_Fit explicit detination
*
* Destination array: [page /Fit]
*
* Display the page designated by page, with its contents magnified just enough
* to fit the entire page within the window both horizontally and vertically. If
* the required horizontal and vertical magnification factors are different, use
* the smaller of the two, centering the page within the window in the other
* dimension.
*
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Destination_Fit extends Zend_Pdf_Destination_Explicit
{
/**
* Create destination object
*
* @param Zend_Pdf_Page|integer $page Page object or page number
* @return Zend_Pdf_Destination_Fit
* @throws Zend_Pdf_Exception
*/
public static function create($page)
{
$destinationArray = new Zend_Pdf_Element_Array();
if ($page instanceof Zend_Pdf_Page) {
$destinationArray->items[] = $page->getPageDictionary();
} else if (is_integer($page)) {
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
} else {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or a page number.');
}
$destinationArray->items[] = new Zend_Pdf_Element_Name('Fit');
return new Zend_Pdf_Destination_Fit($destinationArray);
}
}

View file

@ -0,0 +1,75 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: FitBoundingBox.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element/Array.php';
require_once 'Zend/Pdf/Element/Name.php';
require_once 'Zend/Pdf/Element/Numeric.php';
/** Zend_Pdf_Destination_Explicit */
require_once 'Zend/Pdf/Destination/Explicit.php';
/**
* Zend_Pdf_Destination_FitBoundingBox explicit detination
*
* Destination array: [page /FitB]
*
* (PDF 1.1) Display the page designated by page, with its contents magnified
* just enough to fit its bounding box entirely within the window both horizontally
* and vertically. If the required horizontal and vertical magnification
* factors are different, use the smaller of the two, centering the bounding box
* within the window in the other dimension.
*
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Destination_FitBoundingBox extends Zend_Pdf_Destination_Explicit
{
/**
* Create destination object
*
* @param Zend_Pdf_Page|integer $page Page object or page number
* @return Zend_Pdf_Destination_FitBoundingBox
* @throws Zend_Pdf_Exception
*/
public static function create($page)
{
$destinationArray = new Zend_Pdf_Element_Array();
if ($page instanceof Zend_Pdf_Page) {
$destinationArray->items[] = $page->getPageDictionary();
} else if (is_integer($page)) {
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
} else {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or a page number.');
}
$destinationArray->items[] = new Zend_Pdf_Element_Name('FitB');
return new Zend_Pdf_Destination_FitBoundingBox($destinationArray);
}
}

View file

@ -0,0 +1,98 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: FitBoundingBoxHorizontally.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element/Array.php';
require_once 'Zend/Pdf/Element/Name.php';
require_once 'Zend/Pdf/Element/Numeric.php';
/** Zend_Pdf_Destination_Explicit */
require_once 'Zend/Pdf/Destination/Explicit.php';
/**
* Zend_Pdf_Destination_FitBoundingBoxHorizontally explicit detination
*
* Destination array: [page /FitBH top]
*
* (PDF 1.1) Display the page designated by page, with the vertical coordinate
* top positioned at the top edge of the window and the contents of the page
* magnified just enough to fit the entire width of its bounding box within the
* window.
*
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Destination_FitBoundingBoxHorizontally extends Zend_Pdf_Destination_Explicit
{
/**
* Create destination object
*
* @param Zend_Pdf_Page|integer $page Page object or page number
* @param float $top Top edge of displayed page
* @return Zend_Pdf_Destination_FitBoundingBoxHorizontally
* @throws Zend_Pdf_Exception
*/
public static function create($page, $top)
{
$destinationArray = new Zend_Pdf_Element_Array();
if ($page instanceof Zend_Pdf_Page) {
$destinationArray->items[] = $page->getPageDictionary();
} else if (is_integer($page)) {
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
} else {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or a page number.');
}
$destinationArray->items[] = new Zend_Pdf_Element_Name('FitBH');
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($top);
return new Zend_Pdf_Destination_FitBoundingBoxHorizontally($destinationArray);
}
/**
* Get top edge of the displayed page
*
* @return float
*/
public function getTopEdge()
{
return $this->_destinationArray->items[2]->value;
}
/**
* Set top edge of the displayed page
*
* @param float $top
* @return Zend_Pdf_Action_FitBoundingBoxHorizontally
*/
public function setTopEdge($top)
{
$this->_destinationArray->items[2] = new Zend_Pdf_Element_Numeric($top);
return $this;
}
}

View file

@ -0,0 +1,98 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: FitBoundingBoxVertically.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element/Array.php';
require_once 'Zend/Pdf/Element/Name.php';
require_once 'Zend/Pdf/Element/Numeric.php';
/** Zend_Pdf_Destination_Explicit */
require_once 'Zend/Pdf/Destination/Explicit.php';
/**
* Zend_Pdf_Destination_FitBoundingBoxVertically explicit detination
*
* Destination array: [page /FitBV left]
*
* (PDF 1.1) Display the page designated by page, with the horizontal coordinate
* left positioned at the left edge of the window and the contents of the page
* magnified just enough to fit the entire height of its bounding box within the
* window.
*
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Destination_FitBoundingBoxVertically extends Zend_Pdf_Destination_Explicit
{
/**
* Create destination object
*
* @param Zend_Pdf_Page|integer $page Page object or page number
* @param float $left Left edge of displayed page
* @return Zend_Pdf_Destination_FitBoundingBoxVertically
* @throws Zend_Pdf_Exception
*/
public static function create($page, $left)
{
$destinationArray = new Zend_Pdf_Element_Array();
if ($page instanceof Zend_Pdf_Page) {
$destinationArray->items[] = $page->getPageDictionary();
} else if (is_integer($page)) {
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
} else {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or a page number.');
}
$destinationArray->items[] = new Zend_Pdf_Element_Name('FitBV');
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($left);
return new Zend_Pdf_Destination_FitBoundingBoxVertically($destinationArray);
}
/**
* Get left edge of the displayed page
*
* @return float
*/
public function getLeftEdge()
{
return $this->_destinationArray->items[2]->value;
}
/**
* Set left edge of the displayed page
*
* @param float $left
* @return Zend_Pdf_Action_FitBoundingBoxVertically
*/
public function setLeftEdge($left)
{
$this->_destinationArray->items[2] = new Zend_Pdf_Element_Numeric($left);
return $this;
}
}

View file

@ -0,0 +1,98 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: FitHorizontally.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element/Array.php';
require_once 'Zend/Pdf/Element/Name.php';
require_once 'Zend/Pdf/Element/Numeric.php';
/** Zend_Pdf_Destination_Explicit */
require_once 'Zend/Pdf/Destination/Explicit.php';
/**
* Zend_Pdf_Destination_FitHorizontally explicit detination
*
* Destination array: [page /FitH top]
*
* Display the page designated by page, with the vertical coordinate top positioned
* at the top edge of the window and the contents of the page magnified
* just enough to fit the entire width of the page within the window.
*
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Destination_FitHorizontally extends Zend_Pdf_Destination_Explicit
{
/**
* Create destination object
*
* @param Zend_Pdf_Page|integer $page Page object or page number
* @param float $top Top edge of displayed page
* @return Zend_Pdf_Destination_FitHorizontally
* @throws Zend_Pdf_Exception
*/
public static function create($page, $top)
{
$destinationArray = new Zend_Pdf_Element_Array();
if ($page instanceof Zend_Pdf_Page) {
$destinationArray->items[] = $page->getPageDictionary();
} else if (is_integer($page)) {
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
} else {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or a page number.');
}
$destinationArray->items[] = new Zend_Pdf_Element_Name('FitH');
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($top);
return new Zend_Pdf_Destination_FitHorizontally($destinationArray);
}
/**
* Get top edge of the displayed page
*
* @return float
*/
public function getTopEdge()
{
return $this->_destinationArray->items[2]->value;
}
/**
* Set top edge of the displayed page
*
* @param float $top
* @return Zend_Pdf_Action_FitHorizontally
*/
public function setTopEdge($top)
{
$this->_destinationArray->items[2] = new Zend_Pdf_Element_Numeric($top);
return $this;
}
}

View file

@ -0,0 +1,171 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: FitRectangle.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element/Array.php';
require_once 'Zend/Pdf/Element/Name.php';
require_once 'Zend/Pdf/Element/Numeric.php';
/** Zend_Pdf_Destination_Explicit */
require_once 'Zend/Pdf/Destination/Explicit.php';
/**
* Zend_Pdf_Destination_FitRectangle explicit detination
*
* Destination array: [page /FitR left bottom right top]
*
* Display the page designated by page, with its contents magnified just enough
* to fit the rectangle specified by the coordinates left, bottom, right, and top
* entirely within the window both horizontally and vertically. If the required
* horizontal and vertical magnification factors are different, use the smaller of
* the two, centering the rectangle within the window in the other dimension.
*
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Destination_FitRectangle extends Zend_Pdf_Destination_Explicit
{
/**
* Create destination object
*
* @param Zend_Pdf_Page|integer $page Page object or page number
* @param float $left Left edge of displayed page
* @param float $bottom Bottom edge of displayed page
* @param float $right Right edge of displayed page
* @param float $top Top edge of displayed page
* @return Zend_Pdf_Destination_FitRectangle
* @throws Zend_Pdf_Exception
*/
public static function create($page, $left, $bottom, $right, $top)
{
$destinationArray = new Zend_Pdf_Element_Array();
if ($page instanceof Zend_Pdf_Page) {
$destinationArray->items[] = $page->getPageDictionary();
} else if (is_integer($page)) {
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
} else {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or a page number.');
}
$destinationArray->items[] = new Zend_Pdf_Element_Name('FitR');
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($left);
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($bottom);
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($right);
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($top);
return new Zend_Pdf_Destination_FitRectangle($destinationArray);
}
/**
* Get left edge of the displayed page
*
* @return float
*/
public function getLeftEdge()
{
return $this->_destinationArray->items[2]->value;
}
/**
* Set left edge of the displayed page
*
* @param float $left
* @return Zend_Pdf_Action_FitRectangle
*/
public function setLeftEdge($left)
{
$this->_destinationArray->items[2] = new Zend_Pdf_Element_Numeric($left);
return $this;
}
/**
* Get bottom edge of the displayed page
*
* @return float
*/
public function getBottomEdge()
{
return $this->_destinationArray->items[3]->value;
}
/**
* Set bottom edge of the displayed page
*
* @param float $bottom
* @return Zend_Pdf_Action_FitRectangle
*/
public function setBottomEdge($bottom)
{
$this->_destinationArray->items[3] = new Zend_Pdf_Element_Numeric($bottom);
return $this;
}
/**
* Get right edge of the displayed page
*
* @return float
*/
public function getRightEdge()
{
return $this->_destinationArray->items[4]->value;
}
/**
* Set right edge of the displayed page
*
* @param float $right
* @return Zend_Pdf_Action_FitRectangle
*/
public function setRightEdge($right)
{
$this->_destinationArray->items[4] = new Zend_Pdf_Element_Numeric($right);
return $this;
}
/**
* Get top edge of the displayed page
*
* @return float
*/
public function getTopEdge()
{
return $this->_destinationArray->items[5]->value;
}
/**
* Set top edge of the displayed page
*
* @param float $top
* @return Zend_Pdf_Action_FitRectangle
*/
public function setTopEdge($top)
{
$this->_destinationArray->items[5] = new Zend_Pdf_Element_Numeric($top);
return $this;
}
}

View file

@ -0,0 +1,98 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: FitVertically.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element/Array.php';
require_once 'Zend/Pdf/Element/Name.php';
require_once 'Zend/Pdf/Element/Numeric.php';
/** Zend_Pdf_Destination_Explicit */
require_once 'Zend/Pdf/Destination/Explicit.php';
/**
* Zend_Pdf_Destination_FitVertically explicit detination
*
* Destination array: [page /FitV left]
*
* Display the page designated by page, with the horizontal coordinate left positioned
* at the left edge of the window and the contents of the page magnified
* just enough to fit the entire height of the page within the window.
*
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Destination_FitVertically extends Zend_Pdf_Destination_Explicit
{
/**
* Create destination object
*
* @param Zend_Pdf_Page|integer $page Page object or page number
* @param float $left Left edge of displayed page
* @return Zend_Pdf_Destination_FitVertically
* @throws Zend_Pdf_Exception
*/
public static function create($page, $left)
{
$destinationArray = new Zend_Pdf_Element_Array();
if ($page instanceof Zend_Pdf_Page) {
$destinationArray->items[] = $page->getPageDictionary();
} else if (is_integer($page)) {
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
} else {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or page number.');
}
$destinationArray->items[] = new Zend_Pdf_Element_Name('FitV');
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($left);
return new Zend_Pdf_Destination_FitVertically($destinationArray);
}
/**
* Get left edge of the displayed page
*
* @return float
*/
public function getLeftEdge()
{
return $this->_destinationArray->items[2]->value;
}
/**
* Set left edge of the displayed page
*
* @param float $left
* @return Zend_Pdf_Action_FitVertically
*/
public function setLeftEdge($left)
{
$this->_destinationArray->items[2] = new Zend_Pdf_Element_Numeric($left);
return $this;
}
}

View file

@ -0,0 +1,101 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Named.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element.php';
require_once 'Zend/Pdf/Element/String.php';
/** Zend_Pdf_Destination */
require_once 'Zend/Pdf/Destination.php';
/**
* Destination array: [page /Fit]
*
* Display the page designated by page, with its contents magnified just enough
* to fit the entire page within the window both horizontally and vertically. If
* the required horizontal and vertical magnification factors are different, use
* the smaller of the two, centering the page within the window in the other
* dimension.
*
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Destination_Named extends Zend_Pdf_Destination
{
/**
* Destination name
*
* @var Zend_Pdf_Element_Name|Zend_Pdf_Element_String
*/
protected $_nameElement;
/**
* Named destination object constructor
*
* @param $resource
* @throws Zend_Pdf_Exception
*/
public function __construct(Zend_Pdf_Element $resource)
{
if ($resource->getType() != Zend_Pdf_Element::TYPE_NAME && $resource->getType() != Zend_Pdf_Element::TYPE_STRING) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Named destination resource must be a PDF name or a PDF string.');
}
$this->_nameElement = $resource;
}
/**
* Create named destination object
*
* @param string $name
* @return Zend_Pdf_Destination_Named
*/
public static function create($name)
{
return new Zend_Pdf_Destination_Named(new Zend_Pdf_Element_String($name));
}
/**
* Get name
*
* @return Zend_Pdf_Element
*/
public function getName()
{
return $this->_nameElement->value;
}
/**
* Get resource
*
* @internal
* @return Zend_Pdf_Element
*/
public function getResource()
{
return $this->_nameElement;
}
}

View file

@ -0,0 +1,37 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Unknown.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Destination_Explicit */
require_once 'Zend/Pdf/Destination/Explicit.php';
/**
* Unrecognized explicit destination representation class
*
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Destination_Unknown extends Zend_Pdf_Destination_Explicit
{
}

View file

@ -0,0 +1,177 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Zoom.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element/Array.php';
require_once 'Zend/Pdf/Element/Name.php';
require_once 'Zend/Pdf/Element/Null.php';
require_once 'Zend/Pdf/Element/Numeric.php';
/** Zend_Pdf_Destination_Explicit */
require_once 'Zend/Pdf/Destination/Explicit.php';
/**
* Zend_Pdf_Destination_Zoom explicit detination
*
* Destination array: [page /XYZ left top zoom]
*
* Display the page designated by page, with the coordinates (left, top) positioned
* at the upper-left corner of the window and the contents of the page
* magnified by the factor zoom. A null value for any of the parameters left, top,
* or zoom specifies that the current value of that parameter is to be retained unchanged.
* A zoom value of 0 has the same meaning as a null value.
*
* @package Zend_Pdf
* @subpackage Destination
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Destination_Zoom extends Zend_Pdf_Destination_Explicit
{
/**
* Create destination object
*
* @param Zend_Pdf_Page|integer $page Page object or page number
* @param float $left Left edge of displayed page
* @param float $top Top edge of displayed page
* @param float $zoom Zoom factor
* @return Zend_Pdf_Destination_Zoom
* @throws Zend_Pdf_Exception
*/
public static function create($page, $left = null, $top = null, $zoom = null)
{
$destinationArray = new Zend_Pdf_Element_Array();
if ($page instanceof Zend_Pdf_Page) {
$destinationArray->items[] = $page->getPageDictionary();
} else if (is_integer($page)) {
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($page);
} else {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Page entry must be a Zend_Pdf_Page object or a page number.');
}
$destinationArray->items[] = new Zend_Pdf_Element_Name('XYZ');
if ($left === null) {
$destinationArray->items[] = new Zend_Pdf_Element_Null();
} else {
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($left);
}
if ($top === null) {
$destinationArray->items[] = new Zend_Pdf_Element_Null();
} else {
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($top);
}
if ($zoom === null) {
$destinationArray->items[] = new Zend_Pdf_Element_Null();
} else {
$destinationArray->items[] = new Zend_Pdf_Element_Numeric($zoom);
}
return new Zend_Pdf_Destination_Zoom($destinationArray);
}
/**
* Get left edge of the displayed page (null means viewer application 'current value')
*
* @return float
*/
public function getLeftEdge()
{
return $this->_destinationArray->items[2]->value;
}
/**
* Set left edge of the displayed page (null means viewer application 'current value')
*
* @param float $left
* @return Zend_Pdf_Action_Zoom
*/
public function setLeftEdge($left)
{
if ($left === null) {
$this->_destinationArray->items[2] = new Zend_Pdf_Element_Null();
} else {
$this->_destinationArray->items[2] = new Zend_Pdf_Element_Numeric($left);
}
return $this;
}
/**
* Get top edge of the displayed page (null means viewer application 'current value')
*
* @return float
*/
public function getTopEdge()
{
return $this->_destinationArray->items[3]->value;
}
/**
* Set top edge of the displayed page (null means viewer application 'current viewer')
*
* @param float $top
* @return Zend_Pdf_Action_Zoom
*/
public function setTopEdge($top)
{
if ($top === null) {
$this->_destinationArray->items[3] = new Zend_Pdf_Element_Null();
} else {
$this->_destinationArray->items[3] = new Zend_Pdf_Element_Numeric($top);
}
return $this;
}
/**
* Get ZoomFactor of the displayed page (null or 0 means viewer application 'current value')
*
* @return float
*/
public function getZoomFactor()
{
return $this->_destinationArray->items[4]->value;
}
/**
* Set ZoomFactor of the displayed page (null or 0 means viewer application 'current viewer')
*
* @param float $zoom
* @return Zend_Pdf_Action_Zoom
*/
public function setZoomFactor($zoom)
{
if ($zoom === null) {
$this->_destinationArray->items[4] = new Zend_Pdf_Element_Null();
} else {
$this->_destinationArray->items[4] = new Zend_Pdf_Element_Numeric($zoom);
}
return $this;
}
}