2 * << Haru Free PDF Library >> -- hpdf_doc.h
4 * URL: http://libharu.org
6 * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
7 * Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
9 * Permission to use, copy, modify, distribute and sell this software
10 * and its documentation for any purpose is hereby granted without fee,
11 * provided that the above copyright notice appear in all copies and
12 * that both that copyright notice and this permission notice appear
13 * in supporting documentation.
14 * It is provided "as is" without express or implied warranty.
22 #define HPDF_SIG_BYTES 0x41504446L
24 #include "hpdf_catalog.h"
25 #include "hpdf_image.h"
26 #include "hpdf_pages.h"
27 #include "hpdf_outline.h"
28 #include "hpdf_ext_gstate.h"
34 #define HPDF_VER_DEFAULT HPDF_VER_12
36 typedef struct _HPDF_Doc_Rec {
37 HPDF_UINT32 sig_bytes;
38 HPDF_PDFVer pdf_version;
42 HPDF_Outline outlines;
44 HPDF_Pages root_pages;
53 HPDF_BYTE ttfont_tag[6];
55 /* list for loaded fontdefs */
56 HPDF_List fontdef_list;
58 /* list for loaded encodings */
59 HPDF_List encoder_list;
61 HPDF_Encoder cur_encoder;
63 /* default compression mode */
64 HPDF_BOOL compression_mode;
67 HPDF_EncryptDict encrypt_dict;
69 HPDF_Encoder def_encoder;
71 HPDF_UINT page_per_pages;
72 HPDF_UINT cur_page_num;
74 /* buffer for saving into memory stream */
78 typedef struct _HPDF_Doc_Rec *HPDF_Doc;
82 HPDF_Doc_FindEncoder (HPDF_Doc pdf,
83 const char *encoding_name);
87 HPDF_Doc_FindFontDef (HPDF_Doc pdf,
88 const char *font_name);
92 HPDF_Doc_FindFont (HPDF_Doc pdf,
93 const char *font_name,
94 const char *encoding_name);
98 HPDF_Doc_Validate (HPDF_Doc pdf);
101 /*----- page handling -------------------------------------------------------*/
104 HPDF_Doc_GetCurrentPages (HPDF_Doc pdf);
108 HPDF_Doc_AddPagesTo (HPDF_Doc pdf,
113 HPDF_Doc_SetCurrentPages (HPDF_Doc pdf,
118 HPDF_Doc_SetCurrentPage (HPDF_Doc pdf,
124 /*----- font handling -------------------------------------------------------*/
127 HPDF_GetFontDef (HPDF_Doc pdf,
128 const char *font_name);
132 HPDF_Doc_RegisterFontDef (HPDF_Doc pdf,
133 HPDF_FontDef fontdef);
136 /*----- encoding handling ---------------------------------------------------*/
139 HPDF_Doc_RegisterEncoder (HPDF_Doc pdf,
140 HPDF_Encoder encoder);
144 /*----- encryptio------------------------------------------------------------*/
147 HPDF_Doc_SetEncryptOn (HPDF_Doc pdf);
151 HPDF_Doc_SetEncryptOff (HPDF_Doc pdf);
155 HPDF_Doc_PrepareEncryption (HPDF_Doc pdf);
159 #endif /* __cplusplus */
161 #endif /* _HPDF_DOC_H */