You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

343 lines
8.5 KiB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  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.
  14. *
  15. * @category Zend
  16. * @package Zend_Pdf
  17. * @subpackage Core
  18. * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /** Zend_Exception */
  23. // require_once 'Zend/Exception.php';
  24. /**
  25. * Exception class for Zend_Pdf.
  26. *
  27. * If you expect a certain type of exception to be caught and handled by the
  28. * caller, create a constant for it here and include it in the object being
  29. * thrown. Example:
  30. *
  31. * throw new Zend_Pdf_Exception('foo() is not yet implemented',
  32. * Zend_Pdf_Exception::NOT_IMPLEMENTED);
  33. *
  34. * This allows the caller to determine the specific type of exception that was
  35. * thrown without resorting to parsing the descriptive text.
  36. *
  37. * IMPORTANT: Do not rely on numeric values of the constants! They are grouped
  38. * sequentially below for organizational purposes only. The numbers may come to
  39. * mean something in the future, but they are subject to renumbering at any
  40. * time. ALWAYS use the symbolic constant names, which are guaranteed never to
  41. * change, in logical checks! You have been warned.
  42. *
  43. * @package Zend_Pdf
  44. * @subpackage Core
  45. * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
  46. * @license http://framework.zend.com/license/new-bsd New BSD License
  47. */
  48. class Zend_Pdf_Exception extends Zend_Exception
  49. {
  50. /**** Class Constants ****/
  51. /* Generic Exceptions */
  52. /**
  53. * The feature or option is planned but has not yet been implemented. It
  54. * should be available in a future revision of the framework.
  55. */
  56. const NOT_IMPLEMENTED = 0x0001;
  57. /**
  58. * The feature or option has been deprecated and will be removed in a future
  59. * revision of the framework. The descriptive text accompanying this
  60. * exception should explain how to use the replacement features or options.
  61. */
  62. const DEPRECATED = 0x0002;
  63. /**
  64. * Not enough paramaters were supplied to the method.
  65. */
  66. const TOO_FEW_PARAMETERS = 0x0003;
  67. /**
  68. * A parameter was of the wrong data type.
  69. */
  70. const BAD_PARAMETER_TYPE = 0x0004;
  71. /**
  72. * A parameter contained an unusable value.
  73. */
  74. const BAD_PARAMETER_VALUE = 0x0005;
  75. /**
  76. * A parameter value was not within the expected range.
  77. */
  78. const PARAMETER_VALUE_OUT_OF_RANGE = 0x0006;
  79. /**
  80. * The method that has multiple signatures could not understand the
  81. * number and/or types of parameters.
  82. */
  83. const BAD_METHOD_SIGNATURE = 0x0007;
  84. /**
  85. * An array or string index was out of range.
  86. */
  87. const INDEX_OUT_OF_RANGE = 0x0008;
  88. /* Filesystem I/O */
  89. /**
  90. * The file path was unusable or invalid.
  91. */
  92. const BAD_FILE_PATH = 0x0101;
  93. /**
  94. * The file is not readable by the current user.
  95. */
  96. const NOT_READABLE = 0x0102;
  97. /**
  98. * The file is not writeable by the current user.
  99. */
  100. const NOT_WRITEABLE = 0x0103;
  101. /**
  102. * The file resource has been closed unexpectedly.
  103. */
  104. const FILE_NOT_OPEN = 0x0104;
  105. /**
  106. * An error was encountered while attempting to open the file.
  107. */
  108. const CANT_OPEN_FILE = 0x0105;
  109. /**
  110. * An error was encountered while attempting to obtain the current file
  111. * position.
  112. */
  113. const CANT_GET_FILE_POSITION = 0x0106;
  114. /**
  115. * An error was encountered while attempting to set a new file position.
  116. */
  117. const CANT_SET_FILE_POSITION = 0x0107;
  118. /**
  119. * An attempt was made to move the current file position before the start
  120. * of the file.
  121. */
  122. const MOVE_BEFORE_START_OF_FILE = 0x0108;
  123. /**
  124. * An attempt was made to move the current file position beyond the end of
  125. * the file.
  126. */
  127. const MOVE_BEYOND_END_OF_FILE = 0x0109;
  128. /**
  129. * An error was encountered while attempting to obtain the file size.
  130. */
  131. const CANT_GET_FILE_SIZE = 0x010a;
  132. /**
  133. * An error was encountered while attempting to read data from the file.
  134. */
  135. const ERROR_DURING_READ = 0x010b;
  136. /**
  137. * An error was encountered while attempting to write data to the file.
  138. */
  139. const ERROR_DURING_WRITE = 0x010c;
  140. /**
  141. * An incompatible page size was specified for a buffered read operation.
  142. */
  143. const INVALID_PAGE_SIZE = 0x010d;
  144. /**
  145. * There is insufficient data to fulfill the read request.
  146. */
  147. const INSUFFICIENT_DATA = 0x010e;
  148. /* Zend_Pdf_FileParser */
  149. /**
  150. * The file parser data source object was invalid or improperly initialized.
  151. */
  152. const BAD_DATA_SOURCE = 0x0201;
  153. /**
  154. * An unknown byte order was specified.
  155. */
  156. const INVALID_BYTE_ORDER = 0x0202;
  157. /**
  158. * An invalid integer size was specified.
  159. */
  160. const INVALID_INTEGER_SIZE = 0x0203;
  161. /**
  162. * An invalid fixed-point number size was specified.
  163. */
  164. const BAD_FIXED_POINT_SIZE = 0x0204;
  165. /**
  166. * The string cannot be read.
  167. */
  168. const CANT_READ_STRING = 0x0205;
  169. /**
  170. * This file type must be parsed in a specific order and a parsing method
  171. * was called out-of-turn.
  172. */
  173. const PARSED_OUT_OF_ORDER = 0x0206;
  174. /* Zend_Pdf_FileParser_Font and Subclasses */
  175. /**
  176. * The font file type is incorrect.
  177. */
  178. const WRONG_FONT_TYPE = 0x0301;
  179. /**
  180. * The number of tables contained in the font is outside the expected range.
  181. */
  182. const BAD_TABLE_COUNT = 0x0302;
  183. /**
  184. * A required table was not present in the font.
  185. */
  186. const REQUIRED_TABLE_NOT_FOUND = 0x0303;
  187. /**
  188. * The parser does not understand this version of this table in the font.
  189. */
  190. const DONT_UNDERSTAND_TABLE_VERSION = 0x0303;
  191. /**
  192. * The magic number in the font file is incorrect.
  193. */
  194. const BAD_MAGIC_NUMBER = 0x0304;
  195. /**
  196. * Could not locate a usable character map for this font.
  197. */
  198. const CANT_FIND_GOOD_CMAP = 0x0305;
  199. /* Zend_Pdf_Cmap and Subclasses */
  200. /**
  201. * The character map type is currently unsupported.
  202. */
  203. const CMAP_TYPE_UNSUPPORTED = 0x0401;
  204. /**
  205. * The type of the character map is not understood.
  206. */
  207. const CMAP_UNKNOWN_TYPE = 0x0402;
  208. /**
  209. * The character map table data is too small.
  210. */
  211. const CMAP_TABLE_DATA_TOO_SMALL = 0x0403;
  212. /**
  213. * The character map table data is for a different type of table.
  214. */
  215. const CMAP_WRONG_TABLE_TYPE = 0x0404;
  216. /**
  217. * The character map table data contains in incorrect length.
  218. */
  219. const CMAP_WRONG_TABLE_LENGTH = 0x0405;
  220. /**
  221. * This character map table is language-dependent. Character maps must be
  222. * language-independent.
  223. */
  224. const CMAP_NOT_LANGUAGE_INDEPENDENT = 0x0406;
  225. /**
  226. * The final byte offset when reading the character map table data does not
  227. * match the reported length of the table.
  228. */
  229. const CMAP_FINAL_OFFSET_NOT_LENGTH = 0x0407;
  230. /**
  231. * The character map subtable entry count does not match the expected value.
  232. */
  233. const CMAP_WRONG_ENTRY_COUNT = 0x0408;
  234. /* Zend_Pdf_Resource_Font and Subclasses */
  235. /**
  236. * The specified glyph number is out of range for this font.
  237. */
  238. const GLYPH_OUT_OF_RANGE = 0x0501;
  239. /**
  240. * This font program has copyright bits set which prevent it from being
  241. * embedded in the PDF file. You must specify the no-embed option to use
  242. * this font.
  243. */
  244. const FONT_CANT_BE_EMBEDDED = 0x0502;
  245. /* Zend_Pdf_Font */
  246. /**
  247. * The font name did not match any previously instantiated font and is not
  248. * one of the standard 14 PDF fonts.
  249. */
  250. const BAD_FONT_NAME = 0x0601;
  251. /**
  252. * The factory method could not determine the type of the font file.
  253. */
  254. const CANT_DETERMINE_FONT_TYPE = 0x0602;
  255. /* Text Layout System */
  256. /**
  257. * The specified attribute value for the text object cannot be used.
  258. */
  259. const BAD_ATTRIBUTE_VALUE = 0x0701;
  260. /* Zend_Pdf_Image and Subclasses */
  261. const CANT_DETERMINE_IMAGE_TYPE = 0x0801;
  262. const WRONG_IMAGE_TYPE = 0x0802;
  263. const UNSUPPORTED_IMAGE_ENCODING_OPTIONS = 0x0803;
  264. const IMAGE_FILE_CORRUPT = 0x0804;
  265. }