本文整理汇总了PHP中Zend_Pdf_Resource类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Pdf_Resource类的具体用法?PHP Zend_Pdf_Resource怎么用?PHP Zend_Pdf_Resource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Pdf_Resource类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _attachResource
/**
* Attach resource to the canvas
*
* Method returns a name of the resource which can be used
* as a resource reference within drawing instructions stream
* Allowed types: 'ExtGState', 'ColorSpace', 'Pattern', 'Shading',
* 'XObject', 'Font', 'Properties'
*
* @param string $type
* @param Zend_Pdf_Resource $resource
* @return string
*/
protected function _attachResource($type, Zend_Pdf_Resource $resource)
{
// Check, that resource is already attached to resource set.
$resObject = $resource->getResource();
foreach ($this->_resources[$type] as $resName => $collectedResObject) {
if ($collectedResObject === $resObject) {
return $resName;
}
}
$idCounter = 1;
do {
$newResName = $type[0] . $idCounter++;
} while (isset($this->_resources[$type][$newResName]));
$this->_resources[$type][$newResName] = $resObject;
return $newResName;
}
开发者ID:ngchie,项目名称:system,代码行数:28,代码来源:Canvas.php
示例2: _attachResource
/**
* Attach resource to the page
*
* @param string $type
* @param Zend_Pdf_Resource $resource
* @return string
*/
protected function _attachResource($type, Zend_Pdf_Resource $resource)
{
// Check that Resources dictionary contains appropriate resource set
if ($this->_pageDictionary->Resources->{$type} === null) {
$this->_pageDictionary->Resources->touch();
$this->_pageDictionary->Resources->{$type} = new Zend_Pdf_Element_Dictionary();
} else {
$this->_pageDictionary->Resources->{$type}->touch();
}
// Check, that resource is already attached to resource set.
$resObject = $resource->getResource();
foreach ($this->_pageDictionary->Resources->{$type}->getKeys() as $ResID) {
if ($this->_pageDictionary->Resources->{$type}->{$ResID} === $resObject) {
return $ResID;
}
}
$idCounter = 1;
do {
$newResName = $type[0] . $idCounter++;
} while ($this->_pageDictionary->Resources->{$type}->{$newResName} !== null);
$this->_pageDictionary->Resources->{$type}->{$newResName} = $resObject;
$this->_objFactory->attach($resource->getFactory());
return $newResName;
}
开发者ID:chaimvaid,项目名称:linet3,代码行数:31,代码来源:Page.php
示例3: __construct
/**
* Object constructor.
*/
public function __construct()
{
parent::__construct('');
$this->_resource->dictionary->Type = new Zend_Pdf_Element_Name('XObject');
$this->_resource->dictionary->Subtype = new Zend_Pdf_Element_Name('Image');
}
开发者ID:nhp,项目名称:shopware-4,代码行数:10,代码来源:Image.php
示例4: __construct
/**
* Object constructor.
*
* @param Zend_Pdf_Element_Object_Stream|string $contentStreamObject
* @throws Zend_Pdf_Exception
*/
public function __construct($contentStreamObject = '')
{
if ($contentStreamObject !== null && !$contentStreamObject instanceof Zend_Pdf_Element_Object_Stream && !is_string($contentStreamObject)) {
require_once PHP_LIBRARY_PATH . 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Content stream parameter must be a string or stream object');
}
parent::__construct($contentStreamObject);
}
开发者ID:netixx,项目名称:Stock,代码行数:14,代码来源:ContentStream.php
示例5: __construct
/**
* Object constructor.
*
* @param Zend_Pdf_Element_Object $extGStateObject
* @throws Zend_Pdf_Exception
*/
public function __construct(Zend_Pdf_Element_Object $extGStateObject = null)
{
if ($extGStateObject == null) {
// Create new Graphics State object
require_once 'Zend/Pdf/ElementFactory.php';
$factory = Zend_Pdf_ElementFactory::createFactory(1);
$gsDictionary = new Zend_Pdf_Element_Dictionary();
$gsDictionary->Type = new Zend_Pdf_Element_Name('ExtGState');
$extGStateObject = $factory->newObject($gsDictionary);
}
if ($extGStateObject->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Graphics state PDF object must be a dictionary');
}
parent::__construct($gsDictionary);
}
开发者ID:Simarpreet05,项目名称:joomla,代码行数:22,代码来源:GraphicsState.php
示例6: __construct
/**
* Object constructor.
*
*/
public function __construct()
{
parent::__construct(new Zend_Pdf_Element_Dictionary());
$this->_resource->Type = new Zend_Pdf_Element_Name('Font');
}
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:9,代码来源:Font.php
示例7: __construct
/**
* Object constructor.
*
* The $embeddingOptions parameter allows you to set certain flags related
* to font embedding. You may combine options by OR-ing them together. See
* the EMBED_ constants defined in {@link Zend_Pdf_Font} for the list of
* available options and their descriptions.
*
* @param integer $embeddingOptions (optional) Options for font embedding.
* Only used for certain font types.
*/
public function __construct($embeddingOptions = 0)
{
parent::__construct(new Zend_Pdf_Element_Dictionary());
$this->_resource->Type = new Zend_Pdf_Element_Name('Font');
$this->_embeddingOptions = $embeddingOptions;
}
开发者ID:jorgenils,项目名称:zend-framework,代码行数:17,代码来源:Font.php
注:本文中的Zend_Pdf_Resource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论