File indexing completed on 2024-12-22 05:36:56
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_Pdf 0017 * @subpackage Core 0018 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0019 * @license http://framework.zend.com/license/new-bsd New BSD License 0020 * @version $Id$ 0021 */ 0022 0023 /** Zend_Exception */ 0024 // require_once 'Zend/Exception.php'; 0025 0026 0027 /** 0028 * Exception class for Zend_Pdf. 0029 * 0030 * If you expect a certain type of exception to be caught and handled by the 0031 * caller, create a constant for it here and include it in the object being 0032 * thrown. Example: 0033 * 0034 * throw new Zend_Pdf_Exception('foo() is not yet implemented', 0035 * Zend_Pdf_Exception::NOT_IMPLEMENTED); 0036 * 0037 * This allows the caller to determine the specific type of exception that was 0038 * thrown without resorting to parsing the descriptive text. 0039 * 0040 * IMPORTANT: Do not rely on numeric values of the constants! They are grouped 0041 * sequentially below for organizational purposes only. The numbers may come to 0042 * mean something in the future, but they are subject to renumbering at any 0043 * time. ALWAYS use the symbolic constant names, which are guaranteed never to 0044 * change, in logical checks! You have been warned. 0045 * 0046 * @package Zend_Pdf 0047 * @subpackage Core 0048 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0049 * @license http://framework.zend.com/license/new-bsd New BSD License 0050 */ 0051 class Zend_Pdf_Exception extends Zend_Exception 0052 { 0053 /**** Class Constants ****/ 0054 0055 0056 /* Generic Exceptions */ 0057 0058 /** 0059 * The feature or option is planned but has not yet been implemented. It 0060 * should be available in a future revision of the framework. 0061 */ 0062 const NOT_IMPLEMENTED = 0x0001; 0063 0064 /** 0065 * The feature or option has been deprecated and will be removed in a future 0066 * revision of the framework. The descriptive text accompanying this 0067 * exception should explain how to use the replacement features or options. 0068 */ 0069 const DEPRECATED = 0x0002; 0070 0071 /** 0072 * Not enough paramaters were supplied to the method. 0073 */ 0074 const TOO_FEW_PARAMETERS = 0x0003; 0075 0076 /** 0077 * A parameter was of the wrong data type. 0078 */ 0079 const BAD_PARAMETER_TYPE = 0x0004; 0080 0081 /** 0082 * A parameter contained an unusable value. 0083 */ 0084 const BAD_PARAMETER_VALUE = 0x0005; 0085 0086 /** 0087 * A parameter value was not within the expected range. 0088 */ 0089 const PARAMETER_VALUE_OUT_OF_RANGE = 0x0006; 0090 0091 /** 0092 * The method that has multiple signatures could not understand the 0093 * number and/or types of parameters. 0094 */ 0095 const BAD_METHOD_SIGNATURE = 0x0007; 0096 0097 /** 0098 * An array or string index was out of range. 0099 */ 0100 const INDEX_OUT_OF_RANGE = 0x0008; 0101 0102 0103 0104 /* Filesystem I/O */ 0105 0106 /** 0107 * The file path was unusable or invalid. 0108 */ 0109 const BAD_FILE_PATH = 0x0101; 0110 0111 /** 0112 * The file is not readable by the current user. 0113 */ 0114 const NOT_READABLE = 0x0102; 0115 0116 /** 0117 * The file is not writeable by the current user. 0118 */ 0119 const NOT_WRITEABLE = 0x0103; 0120 0121 /** 0122 * The file resource has been closed unexpectedly. 0123 */ 0124 const FILE_NOT_OPEN = 0x0104; 0125 0126 /** 0127 * An error was encountered while attempting to open the file. 0128 */ 0129 const CANT_OPEN_FILE = 0x0105; 0130 0131 /** 0132 * An error was encountered while attempting to obtain the current file 0133 * position. 0134 */ 0135 const CANT_GET_FILE_POSITION = 0x0106; 0136 0137 /** 0138 * An error was encountered while attempting to set a new file position. 0139 */ 0140 const CANT_SET_FILE_POSITION = 0x0107; 0141 0142 /** 0143 * An attempt was made to move the current file position before the start 0144 * of the file. 0145 */ 0146 const MOVE_BEFORE_START_OF_FILE = 0x0108; 0147 0148 /** 0149 * An attempt was made to move the current file position beyond the end of 0150 * the file. 0151 */ 0152 const MOVE_BEYOND_END_OF_FILE = 0x0109; 0153 0154 /** 0155 * An error was encountered while attempting to obtain the file size. 0156 */ 0157 const CANT_GET_FILE_SIZE = 0x010a; 0158 0159 /** 0160 * An error was encountered while attempting to read data from the file. 0161 */ 0162 const ERROR_DURING_READ = 0x010b; 0163 0164 /** 0165 * An error was encountered while attempting to write data to the file. 0166 */ 0167 const ERROR_DURING_WRITE = 0x010c; 0168 0169 /** 0170 * An incompatible page size was specified for a buffered read operation. 0171 */ 0172 const INVALID_PAGE_SIZE = 0x010d; 0173 0174 /** 0175 * There is insufficient data to fulfill the read request. 0176 */ 0177 const INSUFFICIENT_DATA = 0x010e; 0178 0179 0180 0181 /* Zend_Pdf_FileParser */ 0182 0183 /** 0184 * The file parser data source object was invalid or improperly initialized. 0185 */ 0186 const BAD_DATA_SOURCE = 0x0201; 0187 0188 /** 0189 * An unknown byte order was specified. 0190 */ 0191 const INVALID_BYTE_ORDER = 0x0202; 0192 0193 /** 0194 * An invalid integer size was specified. 0195 */ 0196 const INVALID_INTEGER_SIZE = 0x0203; 0197 0198 /** 0199 * An invalid fixed-point number size was specified. 0200 */ 0201 const BAD_FIXED_POINT_SIZE = 0x0204; 0202 0203 /** 0204 * The string cannot be read. 0205 */ 0206 const CANT_READ_STRING = 0x0205; 0207 0208 /** 0209 * This file type must be parsed in a specific order and a parsing method 0210 * was called out-of-turn. 0211 */ 0212 const PARSED_OUT_OF_ORDER = 0x0206; 0213 0214 0215 0216 /* Zend_Pdf_FileParser_Font and Subclasses */ 0217 0218 /** 0219 * The font file type is incorrect. 0220 */ 0221 const WRONG_FONT_TYPE = 0x0301; 0222 0223 /** 0224 * The number of tables contained in the font is outside the expected range. 0225 */ 0226 const BAD_TABLE_COUNT = 0x0302; 0227 0228 /** 0229 * A required table was not present in the font. 0230 */ 0231 const REQUIRED_TABLE_NOT_FOUND = 0x0303; 0232 0233 /** 0234 * The parser does not understand this version of this table in the font. 0235 */ 0236 const DONT_UNDERSTAND_TABLE_VERSION = 0x0303; 0237 0238 /** 0239 * The magic number in the font file is incorrect. 0240 */ 0241 const BAD_MAGIC_NUMBER = 0x0304; 0242 0243 /** 0244 * Could not locate a usable character map for this font. 0245 */ 0246 const CANT_FIND_GOOD_CMAP = 0x0305; 0247 0248 0249 0250 /* Zend_Pdf_Cmap and Subclasses */ 0251 0252 /** 0253 * The character map type is currently unsupported. 0254 */ 0255 const CMAP_TYPE_UNSUPPORTED = 0x0401; 0256 0257 /** 0258 * The type of the character map is not understood. 0259 */ 0260 const CMAP_UNKNOWN_TYPE = 0x0402; 0261 0262 /** 0263 * The character map table data is too small. 0264 */ 0265 const CMAP_TABLE_DATA_TOO_SMALL = 0x0403; 0266 0267 /** 0268 * The character map table data is for a different type of table. 0269 */ 0270 const CMAP_WRONG_TABLE_TYPE = 0x0404; 0271 0272 /** 0273 * The character map table data contains in incorrect length. 0274 */ 0275 const CMAP_WRONG_TABLE_LENGTH = 0x0405; 0276 0277 /** 0278 * This character map table is language-dependent. Character maps must be 0279 * language-independent. 0280 */ 0281 const CMAP_NOT_LANGUAGE_INDEPENDENT = 0x0406; 0282 0283 /** 0284 * The final byte offset when reading the character map table data does not 0285 * match the reported length of the table. 0286 */ 0287 const CMAP_FINAL_OFFSET_NOT_LENGTH = 0x0407; 0288 0289 /** 0290 * The character map subtable entry count does not match the expected value. 0291 */ 0292 const CMAP_WRONG_ENTRY_COUNT = 0x0408; 0293 0294 0295 0296 /* Zend_Pdf_Resource_Font and Subclasses */ 0297 0298 /** 0299 * The specified glyph number is out of range for this font. 0300 */ 0301 const GLYPH_OUT_OF_RANGE = 0x0501; 0302 0303 /** 0304 * This font program has copyright bits set which prevent it from being 0305 * embedded in the PDF file. You must specify the no-embed option to use 0306 * this font. 0307 */ 0308 const FONT_CANT_BE_EMBEDDED = 0x0502; 0309 0310 0311 0312 /* Zend_Pdf_Font */ 0313 0314 /** 0315 * The font name did not match any previously instantiated font and is not 0316 * one of the standard 14 PDF fonts. 0317 */ 0318 const BAD_FONT_NAME = 0x0601; 0319 0320 /** 0321 * The factory method could not determine the type of the font file. 0322 */ 0323 const CANT_DETERMINE_FONT_TYPE = 0x0602; 0324 0325 0326 /* Text Layout System */ 0327 0328 /** 0329 * The specified attribute value for the text object cannot be used. 0330 */ 0331 const BAD_ATTRIBUTE_VALUE = 0x0701; 0332 0333 0334 /* Zend_Pdf_Image and Subclasses */ 0335 0336 const CANT_DETERMINE_IMAGE_TYPE = 0x0801; 0337 const WRONG_IMAGE_TYPE = 0x0802; 0338 const UNSUPPORTED_IMAGE_ENCODING_OPTIONS = 0x0803; 0339 const IMAGE_FILE_CORRUPT = 0x0804; 0340 0341 0342 } 0343