7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
24 require_once 'Zend/Exception.php';
28 * Exception class for Zend_Pdf.
30 * If you expect a certain type of exception to be caught and handled by the
31 * caller, create a constant for it here and include it in the object being
34 * throw new Zend_Pdf_Exception('foo() is not yet implemented',
35 * Zend_Pdf_Exception::NOT_IMPLEMENTED);
37 * This allows the caller to determine the specific type of exception that was
38 * thrown without resorting to parsing the descriptive text.
40 * IMPORTANT: Do not rely on numeric values of the constants! They are grouped
41 * sequentially below for organizational purposes only. The numbers may come to
42 * mean something in the future, but they are subject to renumbering at any
43 * time. ALWAYS use the symbolic constant names, which are guaranteed never to
44 * change, in logical checks! You have been warned.
48 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
49 * @license http://framework.zend.com/license/new-bsd New BSD License
51 class Zend_Pdf_Exception
extends Zend_Exception
53 /**** Class Constants ****/
56 /* Generic Exceptions */
59 * The feature or option is planned but has not yet been implemented. It
60 * should be available in a future revision of the framework.
62 const NOT_IMPLEMENTED
= 0x0001;
65 * The feature or option has been deprecated and will be removed in a future
66 * revision of the framework. The descriptive text accompanying this
67 * exception should explain how to use the replacement features or options.
69 const DEPRECATED
= 0x0002;
72 * Not enough paramaters were supplied to the method.
74 const TOO_FEW_PARAMETERS
= 0x0003;
77 * A parameter was of the wrong data type.
79 const BAD_PARAMETER_TYPE
= 0x0004;
82 * A parameter contained an unusable value.
84 const BAD_PARAMETER_VALUE
= 0x0005;
87 * A parameter value was not within the expected range.
89 const PARAMETER_VALUE_OUT_OF_RANGE
= 0x0006;
92 * The method that has multiple signatures could not understand the
93 * number and/or types of parameters.
95 const BAD_METHOD_SIGNATURE
= 0x0007;
98 * An array or string index was out of range.
100 const INDEX_OUT_OF_RANGE
= 0x0008;
107 * The file path was unusable or invalid.
109 const BAD_FILE_PATH
= 0x0101;
112 * The file is not readable by the current user.
114 const NOT_READABLE
= 0x0102;
117 * The file is not writeable by the current user.
119 const NOT_WRITEABLE
= 0x0103;
122 * The file resource has been closed unexpectedly.
124 const FILE_NOT_OPEN
= 0x0104;
127 * An error was encountered while attempting to open the file.
129 const CANT_OPEN_FILE
= 0x0105;
132 * An error was encountered while attempting to obtain the current file
135 const CANT_GET_FILE_POSITION
= 0x0106;
138 * An error was encountered while attempting to set a new file position.
140 const CANT_SET_FILE_POSITION
= 0x0107;
143 * An attempt was made to move the current file position before the start
146 const MOVE_BEFORE_START_OF_FILE
= 0x0108;
149 * An attempt was made to move the current file position beyond the end of
152 const MOVE_BEYOND_END_OF_FILE
= 0x0109;
155 * An error was encountered while attempting to obtain the file size.
157 const CANT_GET_FILE_SIZE
= 0x010a;
160 * An error was encountered while attempting to read data from the file.
162 const ERROR_DURING_READ
= 0x010b;
165 * An error was encountered while attempting to write data to the file.
167 const ERROR_DURING_WRITE
= 0x010c;
170 * An incompatible page size was specified for a buffered read operation.
172 const INVALID_PAGE_SIZE
= 0x010d;
175 * There is insufficient data to fulfill the read request.
177 const INSUFFICIENT_DATA
= 0x010e;
181 /* Zend_Pdf_FileParser */
184 * The file parser data source object was invalid or improperly initialized.
186 const BAD_DATA_SOURCE
= 0x0201;
189 * An unknown byte order was specified.
191 const INVALID_BYTE_ORDER
= 0x0202;
194 * An invalid integer size was specified.
196 const INVALID_INTEGER_SIZE
= 0x0203;
199 * An invalid fixed-point number size was specified.
201 const BAD_FIXED_POINT_SIZE
= 0x0204;
204 * The string cannot be read.
206 const CANT_READ_STRING
= 0x0205;
209 * This file type must be parsed in a specific order and a parsing method
210 * was called out-of-turn.
212 const PARSED_OUT_OF_ORDER
= 0x0206;
216 /* Zend_Pdf_FileParser_Font and Subclasses */
219 * The font file type is incorrect.
221 const WRONG_FONT_TYPE
= 0x0301;
224 * The number of tables contained in the font is outside the expected range.
226 const BAD_TABLE_COUNT
= 0x0302;
229 * A required table was not present in the font.
231 const REQUIRED_TABLE_NOT_FOUND
= 0x0303;
234 * The parser does not understand this version of this table in the font.
236 const DONT_UNDERSTAND_TABLE_VERSION
= 0x0303;
239 * The magic number in the font file is incorrect.
241 const BAD_MAGIC_NUMBER
= 0x0304;
244 * Could not locate a usable character map for this font.
246 const CANT_FIND_GOOD_CMAP
= 0x0305;
250 /* Zend_Pdf_Cmap and Subclasses */
253 * The character map type is currently unsupported.
255 const CMAP_TYPE_UNSUPPORTED
= 0x0401;
258 * The type of the character map is not understood.
260 const CMAP_UNKNOWN_TYPE
= 0x0402;
263 * The character map table data is too small.
265 const CMAP_TABLE_DATA_TOO_SMALL
= 0x0403;
268 * The character map table data is for a different type of table.
270 const CMAP_WRONG_TABLE_TYPE
= 0x0404;
273 * The character map table data contains in incorrect length.
275 const CMAP_WRONG_TABLE_LENGTH
= 0x0405;
278 * This character map table is language-dependent. Character maps must be
279 * language-independent.
281 const CMAP_NOT_LANGUAGE_INDEPENDENT
= 0x0406;
284 * The final byte offset when reading the character map table data does not
285 * match the reported length of the table.
287 const CMAP_FINAL_OFFSET_NOT_LENGTH
= 0x0407;
290 * The character map subtable entry count does not match the expected value.
292 const CMAP_WRONG_ENTRY_COUNT
= 0x0408;
296 /* Zend_Pdf_Resource_Font and Subclasses */
299 * The specified glyph number is out of range for this font.
301 const GLYPH_OUT_OF_RANGE
= 0x0501;
304 * This font program has copyright bits set which prevent it from being
305 * embedded in the PDF file. You must specify the no-embed option to use
308 const FONT_CANT_BE_EMBEDDED
= 0x0502;
315 * The font name did not match any previously instantiated font and is not
316 * one of the standard 14 PDF fonts.
318 const BAD_FONT_NAME
= 0x0601;
321 * The factory method could not determine the type of the font file.
323 const CANT_DETERMINE_FONT_TYPE
= 0x0602;
326 /* Text Layout System */
329 * The specified attribute value for the text object cannot be used.
331 const BAD_ATTRIBUTE_VALUE
= 0x0701;
334 /* Zend_Pdf_Image and Subclasses */
336 const CANT_DETERMINE_IMAGE_TYPE
= 0x0801;
337 const WRONG_IMAGE_TYPE
= 0x0802;
338 const UNSUPPORTED_IMAGE_ENCODING_OPTIONS
= 0x0803;
339 const IMAGE_FILE_CORRUPT
= 0x0804;