hpdf 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/History +57 -0
  2. data/License +25 -0
  3. data/README +165 -0
  4. data/examples/arc_demo.rb +82 -0
  5. data/examples/demo.rb +92 -0
  6. data/examples/encryption.rb +41 -0
  7. data/examples/ext_gstater_demo.rb +171 -0
  8. data/examples/font_demo.rb +67 -0
  9. data/examples/jpfont_demo.rb +122 -0
  10. data/examples/line_demo.rb +301 -0
  11. data/examples/slide_show_demo.rb +139 -0
  12. data/examples/text_demo2.rb +189 -0
  13. data/examples/ttfont_demo.rb +106 -0
  14. data/ext/extconf.rb +6 -0
  15. data/ext/hpdf.c +3779 -0
  16. data/ext/hpdf_annotation.c +415 -0
  17. data/ext/hpdf_array.c +344 -0
  18. data/ext/hpdf_binary.c +117 -0
  19. data/ext/hpdf_boolean.c +47 -0
  20. data/ext/hpdf_catalog.c +354 -0
  21. data/ext/hpdf_destination.c +339 -0
  22. data/ext/hpdf_dict.c +488 -0
  23. data/ext/hpdf_doc.c +2020 -0
  24. data/ext/hpdf_doc_png.c +137 -0
  25. data/ext/hpdf_encoder.c +2991 -0
  26. data/ext/hpdf_encoder_cns.c +36359 -0
  27. data/ext/hpdf_encoder_cnt.c +15307 -0
  28. data/ext/hpdf_encoder_jp.c +16125 -0
  29. data/ext/hpdf_encoder_kr.c +27978 -0
  30. data/ext/hpdf_encrypt.c +632 -0
  31. data/ext/hpdf_encryptdict.c +240 -0
  32. data/ext/hpdf_error.c +114 -0
  33. data/ext/hpdf_ext_gstate.c +150 -0
  34. data/ext/hpdf_font.c +229 -0
  35. data/ext/hpdf_font_cid.c +1030 -0
  36. data/ext/hpdf_font_tt.c +406 -0
  37. data/ext/hpdf_font_type1.c +391 -0
  38. data/ext/hpdf_fontdef.c +56 -0
  39. data/ext/hpdf_fontdef_base14.c +4506 -0
  40. data/ext/hpdf_fontdef_cid.c +194 -0
  41. data/ext/hpdf_fontdef_cns.c +471 -0
  42. data/ext/hpdf_fontdef_cnt.c +250 -0
  43. data/ext/hpdf_fontdef_jp.c +1904 -0
  44. data/ext/hpdf_fontdef_kr.c +1572 -0
  45. data/ext/hpdf_fontdef_tt.c +2230 -0
  46. data/ext/hpdf_fontdef_type1.c +524 -0
  47. data/ext/hpdf_gstate.c +119 -0
  48. data/ext/hpdf_image.c +568 -0
  49. data/ext/hpdf_image_png.c +424 -0
  50. data/ext/hpdf_info.c +164 -0
  51. data/ext/hpdf_list.c +333 -0
  52. data/ext/hpdf_mmgr.c +243 -0
  53. data/ext/hpdf_name.c +71 -0
  54. data/ext/hpdf_null.c +31 -0
  55. data/ext/hpdf_number.c +49 -0
  56. data/ext/hpdf_objects.c +172 -0
  57. data/ext/hpdf_outline.c +329 -0
  58. data/ext/hpdf_page_label.c +74 -0
  59. data/ext/hpdf_page_operator.c +2764 -0
  60. data/ext/hpdf_pages.c +1508 -0
  61. data/ext/hpdf_real.c +61 -0
  62. data/ext/hpdf_streams.c +1435 -0
  63. data/ext/hpdf_string.c +189 -0
  64. data/ext/hpdf_utils.c +438 -0
  65. data/ext/hpdf_xref.c +348 -0
  66. data/ext/include/hpdf.h +1227 -0
  67. data/ext/include/hpdf_annotation.h +74 -0
  68. data/ext/include/hpdf_catalog.h +81 -0
  69. data/ext/include/hpdf_conf.h +76 -0
  70. data/ext/include/hpdf_consts.h +549 -0
  71. data/ext/include/hpdf_destination.h +41 -0
  72. data/ext/include/hpdf_doc.h +159 -0
  73. data/ext/include/hpdf_encoder.h +311 -0
  74. data/ext/include/hpdf_encrypt.h +156 -0
  75. data/ext/include/hpdf_encryptdict.h +66 -0
  76. data/ext/include/hpdf_error.h +201 -0
  77. data/ext/include/hpdf_ext_gstate.h +38 -0
  78. data/ext/include/hpdf_font.h +112 -0
  79. data/ext/include/hpdf_fontdef.h +403 -0
  80. data/ext/include/hpdf_gstate.h +80 -0
  81. data/ext/include/hpdf_image.h +72 -0
  82. data/ext/include/hpdf_info.h +48 -0
  83. data/ext/include/hpdf_list.h +85 -0
  84. data/ext/include/hpdf_mmgr.h +82 -0
  85. data/ext/include/hpdf_objects.h +587 -0
  86. data/ext/include/hpdf_outline.h +74 -0
  87. data/ext/include/hpdf_page_label.h +35 -0
  88. data/ext/include/hpdf_pages.h +128 -0
  89. data/ext/include/hpdf_streams.h +276 -0
  90. data/ext/include/hpdf_types.h +488 -0
  91. data/ext/include/hpdf_utils.h +161 -0
  92. data/tests/arc_demo.rb +82 -0
  93. data/tests/demo.rb +91 -0
  94. data/tests/encryption.rb +41 -0
  95. data/tests/ext_gstater_demo.rb +171 -0
  96. data/tests/font_demo.rb +67 -0
  97. data/tests/line_demo.rb +301 -0
  98. data/tests/slide_show_demo.rb +139 -0
  99. data/tests/test_all_examples.rb +31 -0
  100. data/tests/text_demo2.rb +189 -0
  101. metadata +147 -0
@@ -0,0 +1,156 @@
1
+ /*
2
+ * << Haru Free PDF Library 2.0.0 >> -- hpdf_encrypt.h
3
+ *
4
+ * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
5
+ *
6
+ * Permission to use, copy, modify, distribute and sell this software
7
+ * and its documentation for any purpose is hereby granted without fee,
8
+ * provided that the above copyright notice appear in all copies and
9
+ * that both that copyright notice and this permission notice appear
10
+ * in supporting documentation.
11
+ * It is provided "as is" without express or implied warranty.
12
+ *
13
+ *------------------------------------------------------------------------------
14
+ *
15
+ * The code implements MD5 message-digest algorithm is based on the code
16
+ * written by Colin Plumb.
17
+ * The copyright of it is as follows.
18
+ *
19
+ * This code implements the MD5 message-digest algorithm.
20
+ * The algorithm is due to Ron Rivest. This code was
21
+ * written by Colin Plumb in 1993, no copyright is claimed.
22
+ * This code is in the public domain; do with it what you wish.
23
+ *
24
+ * Equivalent code is available from RSA Data Security, Inc.
25
+ * This code has been tested against that, and is equivalent,
26
+ * except that you don't need to include two pages of legalese
27
+ * with every copy.
28
+ *
29
+ * To compute the message digest of a chunk of bytes, declare an
30
+ * MD5Context structure, pass it to MD5Init, call MD5Update as
31
+ * needed on buffers full of bytes, and then call MD5Final, which
32
+ * will fill a supplied 16-byte array with the digest.
33
+ *
34
+ *---------------------------------------------------------------------------*/
35
+
36
+ #ifndef HPDF_ENCRYPT_H
37
+ #define HPDF_ENCRYPT_H
38
+
39
+ #include "hpdf_mmgr.h"
40
+
41
+ #ifdef __cplusplus
42
+ extern "C" {
43
+ #endif
44
+
45
+ /*----------------------------------------------------------------------------*/
46
+ /*----- encrypt-dict ---------------------------------------------------------*/
47
+
48
+ #define HPDF_ID_LEN 16
49
+ #define HPDF_PASSWD_LEN 32
50
+ #define HPDF_ENCRYPT_KEY_MAX 16
51
+ #define HPDF_MD5_KEY_LEN 16
52
+ #define HPDF_PERMISSION_PAD 0xFFFFFFC0
53
+ #define HPDF_ARC4_BUF_SIZE 256
54
+
55
+
56
+ typedef struct HPDF_MD5Context
57
+ {
58
+ HPDF_UINT32 buf[4];
59
+ HPDF_UINT32 bits[2];
60
+ HPDF_BYTE in[64];
61
+ } HPDF_MD5_CTX;
62
+
63
+
64
+ typedef struct _HPDF_ARC4_Ctx_Rec {
65
+ HPDF_BYTE idx1;
66
+ HPDF_BYTE idx2;
67
+ HPDF_BYTE state[HPDF_ARC4_BUF_SIZE];
68
+ } HPDF_ARC4_Ctx_Rec;
69
+
70
+
71
+ typedef struct _HPDF_Encrypt_Rec *HPDF_Encrypt;
72
+
73
+ typedef struct _HPDF_Encrypt_Rec {
74
+ HPDF_EncryptMode mode;
75
+
76
+ /* key_len must be a multiple of 8, and between 40 to 128 */
77
+ HPDF_UINT key_len;
78
+
79
+ /* owner-password (not encrypted) */
80
+ HPDF_BYTE owner_passwd[HPDF_PASSWD_LEN];
81
+
82
+ /* user-password (not encrypted) */
83
+ HPDF_BYTE user_passwd[HPDF_PASSWD_LEN];
84
+
85
+ /* owner-password (encrypted) */
86
+ HPDF_BYTE owner_key[HPDF_PASSWD_LEN];
87
+
88
+ /* user-password (encrypted) */
89
+ HPDF_BYTE user_key[HPDF_PASSWD_LEN];
90
+
91
+ HPDF_INT permission;
92
+ HPDF_BYTE encrypt_id[HPDF_ID_LEN];
93
+ HPDF_BYTE encryption_key[HPDF_MD5_KEY_LEN + 5];
94
+ HPDF_BYTE md5_encryption_key[HPDF_MD5_KEY_LEN];
95
+ HPDF_ARC4_Ctx_Rec arc4ctx;
96
+ } HPDF_Encrypt_Rec;
97
+
98
+
99
+ void
100
+ HPDF_MD5Init (struct HPDF_MD5Context *ctx);
101
+
102
+
103
+ void
104
+ HPDF_MD5Update (struct HPDF_MD5Context *ctx,
105
+ const HPDF_BYTE *buf,
106
+ HPDF_UINT32 len);
107
+
108
+
109
+ void
110
+ HPDF_MD5Final (HPDF_BYTE digest[16],
111
+ struct HPDF_MD5Context *ctx);
112
+
113
+ void
114
+ HPDF_PadOrTrancatePasswd (const char *pwd,
115
+ HPDF_BYTE *new_pwd);
116
+
117
+
118
+ void
119
+ HPDF_Encrypt_Init (HPDF_Encrypt attr);
120
+
121
+
122
+ void
123
+ HPDF_Encrypt_CreateUserKey (HPDF_Encrypt attr);
124
+
125
+
126
+ void
127
+ HPDF_Encrypt_CreateOwnerKey (HPDF_Encrypt attr);
128
+
129
+
130
+ void
131
+ HPDF_Encrypt_CreateEncryptionKey (HPDF_Encrypt attr);
132
+
133
+
134
+ void
135
+ HPDF_Encrypt_InitKey (HPDF_Encrypt attr,
136
+ HPDF_UINT32 object_id,
137
+ HPDF_UINT16 gen_no);
138
+
139
+
140
+ void
141
+ HPDF_Encrypt_Reset (HPDF_Encrypt attr);
142
+
143
+
144
+ void
145
+ HPDF_Encrypt_CryptBuf (HPDF_Encrypt attr,
146
+ const HPDF_BYTE *src,
147
+ HPDF_BYTE *dst,
148
+ HPDF_UINT len);
149
+
150
+ #ifdef __cplusplus
151
+ }
152
+ #endif /* __cplusplus */
153
+
154
+ #endif /* _HPDF_ENCRYPT_H */
155
+
156
+
@@ -0,0 +1,66 @@
1
+ /*
2
+ * << Haru Free PDF Library 2.0.0 >> -- hpdf_encryptdict.h
3
+ *
4
+ * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
5
+ *
6
+ * Permission to use, copy, modify, distribute and sell this software
7
+ * and its documentation for any purpose is hereby granted without fee,
8
+ * provided that the above copyright notice appear in all copies and
9
+ * that both that copyright notice and this permission notice appear
10
+ * in supporting documentation.
11
+ * It is provided "as is" without express or implied warranty.
12
+ *
13
+ */
14
+
15
+ #ifndef _HPDF_ENCRYPTDICT_H
16
+ #define _HPDF_ENCRYPTDICT_H
17
+
18
+ #include "hpdf_objects.h"
19
+
20
+ #ifdef __cplusplus
21
+ extern "C" {
22
+ #endif
23
+
24
+ /*---------------------------------------------------------------------------*/
25
+ /*------ HPDF_EncryptDict ---------------------------------------------------*/
26
+
27
+ HPDF_EncryptDict
28
+ HPDF_EncryptDict_New (HPDF_MMgr mmgr,
29
+ HPDF_Xref xref);
30
+
31
+
32
+ void
33
+ HPDF_EncryptDict_CreateID (HPDF_EncryptDict dict,
34
+ HPDF_Dict info,
35
+ HPDF_Xref xref);
36
+
37
+
38
+ void
39
+ HPDF_EncryptDict_OnFree (HPDF_Dict obj);
40
+
41
+
42
+ HPDF_STATUS
43
+ HPDF_EncryptDict_SetPassword (HPDF_EncryptDict dict,
44
+ const char *owner_passwd,
45
+ const char *user_passwd);
46
+
47
+
48
+ HPDF_BOOL
49
+ HPDF_EncryptDict_Validate (HPDF_EncryptDict dict);
50
+
51
+
52
+ HPDF_STATUS
53
+ HPDF_EncryptDict_Prepare (HPDF_EncryptDict dict,
54
+ HPDF_Dict info,
55
+ HPDF_Xref xref);
56
+
57
+
58
+ HPDF_Encrypt
59
+ HPDF_EncryptDict_GetAttr (HPDF_EncryptDict dict);
60
+
61
+ #ifdef __cplusplus
62
+ }
63
+ #endif /* __cplusplus */
64
+
65
+ #endif /* _HPDF_ENCRYPTDICT_H */
66
+
@@ -0,0 +1,201 @@
1
+ /*
2
+ * << Haru Free PDF Library 2.0.3 >> -- hpdf_error.h
3
+ *
4
+ * URL http://libharu.sourceforge.net/
5
+ *
6
+ * Copyright (c) 1999-2006 Takeshi Kanno
7
+ *
8
+ * Permission to use, copy, modify, distribute and sell this software
9
+ * and its documentation for any purpose is hereby granted without fee,
10
+ * provided that the above copyright notice appear in all copies and
11
+ * that both that copyright notice and this permission notice appear
12
+ * in supporting documentation.
13
+ * It is provided "as is" without express or implied warranty.
14
+ *
15
+ */
16
+
17
+ #ifndef _HPDF_ERROR_H
18
+ #define _HPDF_ERROR_H
19
+
20
+ #include "hpdf_types.h"
21
+
22
+ #ifdef __cplusplus
23
+ extern "C" {
24
+ #endif
25
+
26
+ /* error-code */
27
+ #define HPDF_ARRAY_COUNT_ERR 0x1001
28
+ #define HPDF_ARRAY_ITEM_NOT_FOUND 0x1002
29
+ #define HPDF_ARRAY_ITEM_UNEXPECTED_TYPE 0x1003
30
+ #define HPDF_BINARY_LENGTH_ERR 0x1004
31
+ #define HPDF_CANNOT_GET_PALLET 0x1005
32
+ #define HPDF_DICT_COUNT_ERR 0x1007
33
+ #define HPDF_DICT_ITEM_NOT_FOUND 0x1008
34
+ #define HPDF_DICT_ITEM_UNEXPECTED_TYPE 0x1009
35
+ #define HPDF_DICT_STREAM_LENGTH_NOT_FOUND 0x100A
36
+ #define HPDF_DOC_ENCRYPTDICT_NOT_FOUND 0x100B
37
+ #define HPDF_DOC_INVALID_OBJECT 0x100C
38
+ /* 0x100D */
39
+ #define HPDF_DUPLICATE_REGISTRATION 0x100E
40
+ #define HPDF_EXCEED_JWW_CODE_NUM_LIMIT 0x100F
41
+ /* 0x1010 */
42
+ #define HPDF_ENCRYPT_INVALID_PASSWORD 0x1011
43
+ /* 0x1012 */
44
+ #define HPDF_ERR_UNKNOWN_CLASS 0x1013
45
+ #define HPDF_EXCEED_GSTATE_LIMIT 0x1014
46
+ #define HPDF_FAILD_TO_ALLOC_MEM 0x1015
47
+ #define HPDF_FILE_IO_ERROR 0x1016
48
+ #define HPDF_FILE_OPEN_ERROR 0x1017
49
+ /* 0x1018 */
50
+ #define HPDF_FONT_EXISTS 0x1019
51
+ #define HPDF_FONT_INVALID_WIDTHS_TABLE 0x101A
52
+ #define HPDF_INVALID_AFM_HEADER 0x101B
53
+ #define HPDF_INVALID_ANNOTATION 0x101C
54
+ /* 0x101D */
55
+ #define HPDF_INVALID_BIT_PER_COMPONENT 0x101E
56
+ #define HPDF_INVALID_CHAR_MATRICS_DATA 0x101F
57
+ #define HPDF_INVALID_COLOR_SPACE 0x1020
58
+ #define HPDF_INVALID_COMPRESSION_MODE 0x1021
59
+ #define HPDF_INVALID_DATE_TIME 0x1022
60
+ #define HPDF_INVALID_DESTINATION 0x1023
61
+ /* 0x1024 */
62
+ #define HPDF_INVALID_DOCUMENT 0x1025
63
+ #define HPDF_INVALID_DOCUMENT_STATE 0x1026
64
+ #define HPDF_INVALID_ENCODER 0x1027
65
+ #define HPDF_INVALID_ENCODER_TYPE 0x1028
66
+ /* 0x1029 */
67
+ /* 0x102A */
68
+ #define HPDF_INVALID_ENCODING_NAME 0x102B
69
+ #define HPDF_INVALID_ENCRYPT_KEY_LEN 0x102C
70
+ #define HPDF_INVALID_FONTDEF_DATA 0x102D
71
+ #define HPDF_INVALID_FONTDEF_TYPE 0x102E
72
+ #define HPDF_INVALID_FONT_NAME 0x102F
73
+ #define HPDF_INVALID_IMAGE 0x1030
74
+ #define HPDF_INVALID_JPEG_DATA 0x1031
75
+ #define HPDF_INVALID_N_DATA 0x1032
76
+ #define HPDF_INVALID_OBJECT 0x1033
77
+ #define HPDF_INVALID_OBJ_ID 0x1034
78
+ #define HPDF_INVALID_OPERATION 0x1035
79
+ #define HPDF_INVALID_OUTLINE 0x1036
80
+ #define HPDF_INVALID_PAGE 0x1037
81
+ #define HPDF_INVALID_PAGES 0x1038
82
+ #define HPDF_INVALID_PARAMETER 0x1039
83
+ /* 0x103A */
84
+ #define HPDF_INVALID_PNG_IMAGE 0x103B
85
+ #define HPDF_INVALID_STREAM 0x103C
86
+ #define HPDF_MISSING_FILE_NAME_ENTRY 0x103D
87
+ /* 0x103E */
88
+ #define HPDF_INVALID_TTC_FILE 0x103F
89
+ #define HPDF_INVALID_TTC_INDEX 0x1040
90
+ #define HPDF_INVALID_WX_DATA 0x1041
91
+ #define HPDF_ITEM_NOT_FOUND 0x1042
92
+ #define HPDF_LIBPNG_ERROR 0x1043
93
+ #define HPDF_NAME_INVALID_VALUE 0x1044
94
+ #define HPDF_NAME_OUT_OF_RANGE 0x1045
95
+ /* 0x1046 */
96
+ /* 0x1047 */
97
+ #define HPDF_PAGE_INVALID_PARAM_COUNT 0x1048
98
+ #define HPDF_PAGES_MISSING_KIDS_ENTRY 0x1049
99
+ #define HPDF_PAGE_CANNOT_FIND_OBJECT 0x104A
100
+ #define HPDF_PAGE_CANNOT_GET_ROOT_PAGES 0x104B
101
+ #define HPDF_PAGE_CANNOT_RESTORE_GSTATE 0x104C
102
+ #define HPDF_PAGE_CANNOT_SET_PARENT 0x104D
103
+ #define HPDF_PAGE_FONT_NOT_FOUND 0x104E
104
+ #define HPDF_PAGE_INVALID_FONT 0x104F
105
+ #define HPDF_PAGE_INVALID_FONT_SIZE 0x1050
106
+ #define HPDF_PAGE_INVALID_GMODE 0x1051
107
+ #define HPDF_PAGE_INVALID_INDEX 0x1052
108
+ #define HPDF_PAGE_INVALID_ROTATE_VALUE 0x1053
109
+ #define HPDF_PAGE_INVALID_SIZE 0x1054
110
+ #define HPDF_PAGE_INVALID_XOBJECT 0x1055
111
+ #define HPDF_PAGE_OUT_OF_RANGE 0x1056
112
+ #define HPDF_REAL_OUT_OF_RANGE 0x1057
113
+ #define HPDF_STREAM_EOF 0x1058
114
+ #define HPDF_STREAM_READLN_CONTINUE 0x1059
115
+ /* 0x105A */
116
+ #define HPDF_STRING_OUT_OF_RANGE 0x105B
117
+ #define HPDF_THIS_FUNC_WAS_SKIPPED 0x105C
118
+ #define HPDF_TTF_CANNOT_EMBEDDING_FONT 0x105D
119
+ #define HPDF_TTF_INVALID_CMAP 0x105E
120
+ #define HPDF_TTF_INVALID_FOMAT 0x105F
121
+ #define HPDF_TTF_MISSING_TABLE 0x1060
122
+ #define HPDF_UNSUPPORTED_FONT_TYPE 0x1061
123
+ #define HPDF_UNSUPPORTED_FUNC 0x1062
124
+ #define HPDF_UNSUPPORTED_JPEG_FORMAT 0x1063
125
+ #define HPDF_UNSUPPORTED_TYPE1_FONT 0x1064
126
+ #define HPDF_XREF_COUNT_ERR 0x1065
127
+ #define HPDF_ZLIB_ERROR 0x1066
128
+ #define HPDF_INVALID_PAGE_INDEX 0x1067
129
+ #define HPDF_INVALID_URI 0x1068
130
+ #define HPDF_PAGE_LAYOUT_OUT_OF_RANGE 0x1069
131
+ #define HPDF_PAGE_MODE_OUT_OF_RANGE 0x1070
132
+ #define HPDF_PAGE_NUM_STYLE_OUT_OF_RANGE 0x1071
133
+ #define HPDF_ANNOT_INVALID_ICON 0x1072
134
+ #define HPDF_ANNOT_INVALID_BORDER_STYLE 0x1073
135
+ #define HPDF_PAGE_INVALID_DIRECTION 0x1074
136
+ #define HPDF_INVALID_FONT 0x1075
137
+ #define HPDF_PAGE_INSUFFICIENT_SPACE 0x1076
138
+ #define HPDF_PAGE_INVALID_DISPLAY_TIME 0x1077
139
+ #define HPDF_PAGE_INVALID_TRANSITION_TIME 0x1078
140
+ #define HPDF_INVALID_PAGE_SLIDESHOW_TYPE 0x1079
141
+ #define HPDF_EXT_GSTATE_OUT_OF_RANGE 0x1080
142
+ #define HPDF_INVALID_EXT_GSTATE 0x1081
143
+ #define HPDF_EXT_GSTATE_READ_ONLY 0x1082
144
+
145
+ /*---------------------------------------------------------------------------*/
146
+ /*----- HPDF_Error ----------------------------------------------------------*/
147
+
148
+ typedef struct _HPDF_Error_Rec *HPDF_Error;
149
+
150
+ typedef struct _HPDF_Error_Rec {
151
+ HPDF_STATUS error_no;
152
+ HPDF_STATUS detail_no;
153
+ HPDF_Error_Handler error_fn;
154
+ void *user_data;
155
+ } HPDF_Error_Rec;
156
+
157
+
158
+ /* HPDF_Error_init
159
+ *
160
+ * if error_fn is NULL, the default-handlers are set as error-handler.
161
+ * user_data is used to identify the object which threw an error.
162
+ *
163
+ */
164
+ void
165
+ HPDF_Error_Init (HPDF_Error error,
166
+ void *user_data);
167
+
168
+
169
+ void
170
+ HPDF_Error_Reset (HPDF_Error error);
171
+
172
+
173
+ HPDF_STATUS
174
+ HPDF_Error_GetCode (HPDF_Error error);
175
+
176
+
177
+ HPDF_STATUS
178
+ HPDF_Error_GetDetailCode (HPDF_Error error);
179
+
180
+
181
+ HPDF_STATUS
182
+ HPDF_SetError (HPDF_Error error,
183
+ HPDF_STATUS error_no,
184
+ HPDF_STATUS detail_no);
185
+
186
+
187
+ HPDF_STATUS
188
+ HPDF_CheckError (HPDF_Error error);
189
+
190
+
191
+ HPDF_STATUS
192
+ HPDF_RaiseError (HPDF_Error error,
193
+ HPDF_STATUS error_no,
194
+ HPDF_STATUS detail_no);
195
+
196
+ #ifdef __cplusplus
197
+ }
198
+ #endif /* __cplusplus */
199
+
200
+ #endif /* _HPDF_ERROR_H */
201
+
@@ -0,0 +1,38 @@
1
+ /*
2
+ * << Haru Free PDF Library 2.0.0 >> -- hpdf_ext_gstate.h
3
+ *
4
+ * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
5
+ *
6
+ * Permission to use, copy, modify, distribute and sell this software
7
+ * and its documentation for any purpose is hereby granted without fee,
8
+ * provided that the above copyright notice appear in all copies and
9
+ * that both that copyright notice and this permission notice appear
10
+ * in supporting documentation.
11
+ * It is provided "as is" without express or implied warranty.
12
+ *
13
+ */
14
+
15
+ #ifndef _HPDF_EXT_GSTATE_H
16
+ #define _HPDF_EXT_GSTATE_H
17
+
18
+ #include "hpdf_objects.h"
19
+
20
+ #ifdef __cplusplus
21
+ extern "C" {
22
+ #endif
23
+
24
+ HPDF_Dict
25
+ HPDF_ExtGState_New (HPDF_MMgr mmgr,
26
+ HPDF_Xref xref);
27
+
28
+
29
+ HPDF_BOOL
30
+ HPDF_ExtGState_Validate (HPDF_ExtGState ext_gstate);
31
+
32
+
33
+ #ifdef __cplusplus
34
+ }
35
+ #endif /* __cplusplus */
36
+
37
+ #endif /* _HPDF_EXT_GSTATE_H */
38
+