OSDN Git Service

binding with libharu.
[putex/putex.git] / src / texsourc / lib / libhpdf / if / vb6 / hpdf.bas
1 Attribute VB_Name = "Module1"
2 ''/*
3 ' * << Haru Free PDF Library 2.0.3 >> -- hpdf.h
4 ' *
5 ' * URL http://libharu.org/
6 ' *
7 ' * Copyright (c) 1999-2006 Takeshi Kanno
8 ' *
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.
15 ' *
16 ' */
17 Public sTemp1  As String
18 Public sTemp2  As String
19
20
21 '#include "hpdf_consts.bas"
22 '#include "hpdf_types.bas"
23
24 'typedef void         *HPDF_HANDLE
25 'typedef HPDF_HANDLE   long
26 'typedef HPDF_HANDLE   long
27 'typedef HPDF_HANDLE   longs
28 'typedef HPDF_HANDLE   HPDF_Stream
29 'typedef HPDF_HANDLE   HPDF_Image
30 'typedef HPDF_HANDLE   HPDF_Font
31 'typedef HPDF_HANDLE   HPDF_Outline
32 'typedef HPDF_HANDLE   HPDF_Encoder
33 'typedef HPDF_HANDLE   HPDF_Destination
34 'typedef HPDF_HANDLE   HPDF_XObject
35 'typedef HPDF_HANDLE   HPDF_Annotation
36
37
38 Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
39
40 Public Declare Function HPDF_GetVersion Lib "libhpdf.dll" () As String
41 Public Declare Function HPDF_NewEx Lib "libhpdf.dll" (ByVal user_error_fn As Long, ByVal user_alloc_fn As Long, ByVal user_free_fn As Long, ByVal mem_pool_buf_size As Long, ByVal user_data As Any) As Long
42 Public Declare Function HPDF_New Lib "libhpdf.dll" (ByVal user_error_fn As Long, ByVal user_data As Any) As Long
43 Public Declare Function HPDF_SetErrorHandler Lib "libhpdf.dll" (ByVal pdf As Long, ByVal user_error_fn As Long) As Long
44 Public Declare Sub HPDF_Free Lib "libhpdf.dll" (ByVal pdf As Long)
45 Public Declare Function HPDF_NewDoc Lib "libhpdf.dll" (ByVal pdf As Long) As Long
46 Public Declare Sub HPDF_FreeDoc Lib "libhpdf.dll" (ByVal pdf As Long)
47 Public Declare Function HPDF_HasDoc Lib "libhpdf.dll" (ByVal pdf As Long) As Long
48 Public Declare Function HPDF_FreeDocAll Lib "libhpdf.dll" (ByVal pdf As Long)
49 Public Declare Function HPDF_SaveToStream Lib "libhpdf.dll" (ByVal pdf As Long) As Long
50 Public Declare Function HPDF_GetStreamSize Lib "libhpdf.dll" (ByVal pdf As Long) As Long
51 Public Declare Function HPDF_ReadFromStream Lib "libhpdf.dll" (ByVal pdf As Long, ByRef byt_buf As Long, ByRef lng_size As Long) As Long
52 Public Declare Function HPDF_ResetStream Lib "libhpdf.dll" (ByVal pdf As Long) As Long
53 Public Declare Function HPDF_SaveToFile Lib "libhpdf.dll" (ByVal pdf As Long, ByVal file_name As String) As Long
54 Public Declare Function HPDF_GetError Lib "libhpdf.dll" (ByVal pdf As Long) As Long
55 Public Declare Function HPDF_GetErrorDetail Lib "libhpdf.dll" (ByVal pdf As Long) As Long
56 Public Declare Function HPDF_ResetError Lib "libhpdf.dll" (ByVal pdf As Long)
57 Public Declare Function HPDF_SetPagesConfiguration Lib "libhpdf.dll" (ByVal pdf As Long, ByVal page_per_pages As Long) As Long
58 Public Declare Function HPDF_GetPageByIndex Lib "libhpdf.dll" (ByVal pdf As Long, ByVal index As Long) As Long
59 '/*---------------------------------------------------------------------------*/
60 '/*---------------------------------------------------------------------------*/
61 Public Declare Function HPDF_GetPageLayout Lib "libhpdf.dll" (ByVal pdf As Long) As Long
62 Public Declare Function HPDF_SetPageLayout Lib "libhpdf.dll" (ByVal pdf As Long, ByVal Layout As Long) As Long
63 Public Declare Function HPDF_GetPageMode Lib "libhpdf.dll" (ByVal pdf As Long) As Long
64 Public Declare Function HPDF_SetPageMode Lib "libhpdf.dll" (ByVal pdf As Long, ByVal page_mode As Long) As Long
65 Public Declare Function HPDF_GetViewerPreference Lib "libhpdf.dll" (ByVal pdf As Long) As Long
66 Public Declare Function HPDF_SetViewerPreference Lib "libhpdf.dll" (ByVal pdf As Long, ByVal value As Long) As Long
67 Public Declare Function HPDF_SetOpenAction Lib "libhpdf.dll" (ByVal pdf As Long, ByVal open_action As Long) As Long
68 '/*---------------------------------------------------------------------------*/
69 '/*----- page handling -------------------------------------------------------*/
70 Public Declare Function HPDF_GetCurrentPage Lib "libhpdf.dll" (pdf As Long) As Long
71 Public Declare Function HPDF_AddPage Lib "libhpdf.dll" (ByVal pdf As Long) As Long
72 Public Declare Function HPDF_InsertPage Lib "libhpdf.dll" (pdf As Long, page As Long) As Long
73 Public Declare Function HPDF_Page_SetWidth Lib "libhpdf.dll" (page As Long, value As Single) As Long
74 Public Declare Function HPDF_Page_SetHeight Lib "libhpdf.dll" (page As Long, value As Single) As Long
75 Public Declare Function HPDF_Page_SetSize Lib "libhpdf.dll" (page As Long, ByVal Size As Long, direction As Long) As Long
76 Public Declare Function HPDF_Page_SetRotate Lib "libhpdf.dll" (ByVal page As Long, ByVal angle As Integer) As Long
77 '/*---------------------------------------------------------------------------*/
78 '/*----- font handling -------------------------------------------------------*/
79 Public Declare Function HPDF_GetFont Lib "libhpdf.dll" (ByVal pdf As Long, ByVal font_name As String, ByVal encoding_name As String) As Long
80 Public Declare Function HPDF_LoadType1FontFromFile Lib "libhpdf.dll" (ByVal pdf As Long, ByVal afm_file_name As String, ByVal data_file_name As String) As String
81 Public Declare Function HPDF_LoadTTFontFromFile Lib "libhpdf.dll" (ByVal pdf As Long, ByVal file_name As String, ByVal embedding As Long) As String
82 Public Declare Function HPDF_LoadTTFontFromFile2 Lib "libhpdf.dll" (ByVal pdf As Long, ByVal file_name As String, ByVal index As Long, ByVal embedding As Long) As String
83 Public Declare Function HPDF_AddPageLabel Lib "libhpdf.dll" (ByVal pdf As Long, ByVal page_num As Long, ByVal style As Long, ByVal first_page As Long, ByVal prefix As String) As Long
84 Public Declare Function HPDF_UseJPFonts Lib "libhpdf.dll" (ByVal pdf As Long) As Long
85 Public Declare Function HPDF_UseKRFonts Lib "libhpdf.dll" (ByVal pdf As Long) As Long
86 Public Declare Function HPDF_UseCNSFonts Lib "libhpdf.dll" (ByVal pdf As Long) As Long
87 Public Declare Function HPDF_UseCNTFonts Lib "libhpdf.dll" (ByVal pdf As Long) As Long
88 '/*--------------------------------------------------------------------------*/
89 '/*----- outline ------------------------------------------------------------*/
90 Public Declare Function HPDF_CreateOutline Lib "libhpdf.dll" (ByVal pdf As Long, parent As Long, ByVal title As String, encoder As Long) As Long
91 Public Declare Function HPDF_Outline_SetOpened Lib "libhpdf.dll" (outline As Long, ByVal opened As Long) As Long
92 Public Declare Function HPDF_Outline_SetDestination Lib "libhpdf.dll" (outline As Long, dst As Long) As Long
93 '/*--------------------------------------------------------------------------*/
94 '/*----- destination --------------------------------------------------------*/
95 Public Declare Function HPDF_Page_CreateDestination Lib "libhpdf.dll" (ByVal page As Long) As Long
96 Public Declare Function HPDF_Destination_SetXYZ Lib "libhpdf.dll" (dst As Long, ByVal Left As Single, ByVal top As Single, ByVal zoom As Single) As Long
97 Public Declare Function HPDF_Destination_SetFit Lib "libhpdf.dll" (dst As Long) As Long
98 Public Declare Function HPDF_Destination_SetFitH Lib "libhpdf.dll" (dst As Long, ByVal top As Single) As Long
99 Public Declare Function HPDF_Destination_SetFitV Lib "libhpdf.dll" (dst As Long, ByVal Left As Single) As Long
100 Public Declare Function HPDF_Destination_SetFitR Lib "libhpdf.dll" (dst As Long, ByVal Left As Single, ByVal bottom As Single, ByVal Right As Single, ByVal top As Single) As Long
101 Public Declare Function HPDF_Destination_SetFitB Lib "libhpdf.dll" (dst As Long) As Long
102 Public Declare Function HPDF_Destination_SetFitBH Lib "libhpdf.dll" (dst As Long, ByVal top As Single) As Long
103 Public Declare Function HPDF_Destination_SetFitBV Lib "libhpdf.dll" (dst As Long, ByVal Left As Single) As Long
104 '/*--------------------------------------------------------------------------*/
105 '/*----- encoder ------------------------------------------------------------*/
106 Public Declare Function HPDF_GetEncoder Lib "libhpdf.dll" (ByVal pdf As Long, ByVal encoding_name As String) As Long
107 Public Declare Function HPDF_GetCurrentEncoder Lib "libhpdf.dll" (ByVal pdf As Long) As Long
108 Public Declare Function HPDF_SetCurrentEncoder Lib "libhpdf.dll" (ByVal pdf As Long, ByVal encoding_name As String) As Long
109 Public Declare Function HPDF_Encoder_GetType Lib "libhpdf.dll" (encoder As Long) As Long
110 Public Declare Function HPDF_Encoder_GetByteType Lib "libhpdf.dll" (encoder As Long, ByVal text As String, ByVal index As Long) As Byte
111 Public Declare Function HPDF_Encoder_GetUnicode Lib "libhpdf.dll" (encoder As Long, ByVal code As Integer) As Integer
112 Public Declare Function HPDF_Encoder_GetWritingMode Lib "libhpdf.dll" (encoder As Long) As Long
113 Public Declare Function HPDF_UseJPEncodings Lib "libhpdf.dll" (ByVal pdf As Long) As Long
114 Public Declare Function HPDF_UseKREncodings Lib "libhpdf.dll" (ByVal pdf As Long) As Long
115 Public Declare Function HPDF_UseCNSEncodings Lib "libhpdf.dll" (ByVal pdf As Long) As Long
116 Public Declare Function HPDF_UseCNTEncodings Lib "libhpdf.dll" (ByVal pdf As Long) As Long
117 '/*--------------------------------------------------------------------------*/
118 '/*----- annotation ---------------------------------------------------------*/
119 Public Declare Function HPDF_Page_CreateTextAnnot Lib "libhpdf.dll" (ByVal page As Long, rect As HPDF_Rect, ByVal text As String, ByVal encoder As Long) As Long
120 Public Declare Function HPDF_Page_CreateLinkAnnot Lib "libhpdf.dll" (ByVal page As Long, rect As HPDF_Rect, ByVal dst As Long) As Long
121 Public Declare Function HPDF_Page_CreateURILinkAnnot Lib "libhpdf.dll" (ByVal page As Long, ByVal rect As HPDF_Rect, ByVal uri As String) As Long
122 Public Declare Function HPDF_LinkAnnot_SetHighlightMode Lib "libhpdf.dll" (ByVal annot As Long, mode As HPDF_AnnotHighlightMode) As Long
123 Public Declare Function HPDF_LinkAnnot_SetBorderStyle Lib "libhpdf.dll" (ByVal annot As Long, ByVal Width As Single, ByVal dash_on As Integer, ByVal dash_off As Integer) As Long
124 Public Declare Function HPDF_TextAnnot_SetIcon Lib "libhpdf.dll" (ByVal annot As Long, ByVal icon As HPDF_AnnotIcon) As Long
125 Public Declare Function HPDF_TextAnnot_SetOpened Lib "libhpdf.dll" (ByVal annot As Long, ByVal opened As Long) As Long
126 '/*--------------------------------------------------------------------------*/
127 '/*----- image data ---------------------------------------------------------*/
128 Public Declare Function HPDF_LoadPngImageFromFile Lib "libhpdf.dll" (ByVal pdf As Long, ByVal filename As String) As Long
129 Public Declare Function HPDF_LoadPngImageFromFile2 Lib "libhpdf.dll" (ByVal pdf As Long, ByVal filename As String) As Long
130 Public Declare Function HPDF_LoadJpegImageFromFile Lib "libhpdf.dll" (ByVal pdf As Long, ByVal filename As String) As Long
131 Public Declare Function HPDF_LoadRawImageFromFile Lib "libhpdf.dll" (ByVal pdf As Long, ByVal filename As String, ByVal Width As Long, ByVal height As Long, ByVal color_space As HPDF_ColorSpace) As Long
132 Public Declare Function HPDF_LoadRawImageFromMem Lib "libhpdf.dll" (ByVal pdf As Long, ByRef buf As Byte, ByVal Width As Long, ByVal height As Long, ByVal color_space As HPDF_ColorSpace, ByVal bits_per_component As Long) As Long
133 Public Declare Function HPDF_Image_GetSize Lib "libhpdf.dll" (ByVal image As Long) As Long
134 Public Declare Function HPDF_Image_GetWidth Lib "libhpdf.dll" (ByVal image As Long) As Long
135 Public Declare Function HPDF_Image_GetHeight Lib "libhpdf.dll" (ByVal image As Long) As Long
136 Public Declare Function HPDF_Image_GetBitsPerComponent Lib "libhpdf.dll" (ByVal image As Long) As Long
137 Public Declare Function HPDF_Image_GetColorSpace Lib "libhpdf.dll" (ByVal image As Long) As String
138 Public Declare Function HPDF_Image_SetColorMask Lib "libhpdf.dll" (ByVal image As Long, ByVal rmin As Long, ByVal rmax As Long, ByVal gmin As Long, ByVal gmax As Long, ByVal bmin As Long, ByVal bmax As Long) As Long
139 Public Declare Function HPDF_Image_SetMaskImage Lib "libhpdf.dll" (ByVal image As Long, ByVal mask_image As Long) As Long
140 '/*--------------------------------------------------------------------------*/
141 '/*----- info dictionary ----------------------------------------------------*/
142 Public Declare Function HPDF_SetInfoAttr Lib "libhpdf.dll" (ByVal pdf As Long, type0 As HPDF_InfoType, ByRef value As Long) As Long
143 Public Declare Function HPDF_GetInfoAttr Lib "libhpdf.dll" (ByVal pdf As Long, type0 As HPDF_InfoType) As String
144 Public Declare Function HPDF_SetInfoDateAttr Lib "libhpdf.dll" (ByVal pdf As Long, type0 As HPDF_InfoType, value As HPDF_Date) As Long
145 '/*--------------------------------------------------------------------------*/
146 '/*----- encryption ---------------------------------------------------------*/
147 Public Declare Function HPDF_SetPassword Lib "libhpdf.dll" (ByVal pdf As Long, ByVal owner_passwd As String, ByVal user_passwd As String) As Long
148 Public Declare Function HPDF_SetPermission Lib "libhpdf.dll" (ByVal pdf As Long, ByVal permission As Long) As Long
149 Public Declare Function HPDF_SetEncryptionMode Lib "libhpdf.dll" (ByVal pdf As Long, mode As HPDF_EncryptMode, ByVal key_len As Long) As Long
150 '/*--------------------------------------------------------------------------*/
151 '/*----- compression --------------------------------------------------------*/
152 Public Declare Function HPDF_SetCompressionMode Lib "libhpdf.dll" (ByVal pdf As Long, ByVal mode As Long) As Long
153 '/*--------------------------------------------------------------------------*/
154 '/*--------------------------------------------------------------------------*/
155 Public Declare Function HPDF_Font_GetFontName Lib "libhpdf.dll" (ByVal font As Long) As String
156 Public Declare Function HPDF_Font_GetEncodingName Lib "libhpdf.dll" (ByVal font As Long) As String
157 Public Declare Function HPDF_Font_GetUnicodeWidth Lib "libhpdf.dll" (ByVal font As Long, code As Long) As Long
158 Public Declare Function HPDF_Font_GetBBox Lib "libhpdf.dll" (ByVal font As Long) As HPDF_Box
159 Public Declare Function HPDF_Font_GetAscent Lib "libhpdf.dll" (ByVal font As Long) As Long
160 Public Declare Function HPDF_Font_GetDescent Lib "libhpdf.dll" (ByVal font As Long) As Long
161 Public Declare Function HPDF_Font_GetXHeight Lib "libhpdf.dll" (ByVal font As Long) As Long
162 Public Declare Function HPDF_Font_GetCapHeight Lib "libhpdf.dll" (ByVal font As Long) As Long
163 Public Declare Function HPDF_Font_TextWidth Lib "libhpdf.dll" (ByVal font As Long, ByVal text As Byte, ByRef length As Long) As Single
164 Public Declare Function HPDF_Font_MeasureText Lib "libhpdf.dll" (ByVal font As Long, ByVal text As Byte, ByVal length As Long, ByVal Width As Single, ByVal font_size As Single, ByVal char_space As Single, ByVal word_space As Single, ByVal wordwrap As Long, ByVal real_width As Single) As Long
165 '/*--------------------------------------------------------------------------*/
166 '/*--------------------------------------------------------------------------*/
167 Public Declare Function HPDF_Page_TextWidth Lib "libhpdf.dll" (ByVal page As Long, ByVal text As String) As Single
168 Public Declare Function HPDF_Page_MeasureText Lib "libhpdf.dll" (ByVal page As Long, ByVal text As String, ByVal Width As Single, ByVal wordwrap As Long, ByVal real_width As Single) As Long
169 Public Declare Function HPDF_Page_GetWidth Lib "libhpdf.dll" (ByVal page As Long) As Single
170 Public Declare Function HPDF_Page_GetHeight Lib "libhpdf.dll" (ByVal page As Long) As Single
171 Public Declare Function HPDF_Page_GetGMode Lib "libhpdf.dll" (ByVal page As Long) As Integer
172 Public Declare Function HPDF_Page_GetCurrentPos Lib "libhpdf.dll" (ByVal page As Long) As HPDF_Point
173 Public Declare Function HPDF_Page_GetCurrentTextPos Lib "libhpdf.dll" (ByVal page As Long) As HPDF_Point
174 Public Declare Function HPDF_Page_GetCurrentFont Lib "libhpdf.dll" (ByVal page As Long) As Long
175 Public Declare Function HPDF_Page_GetCurrentFontSize Lib "libhpdf.dll" (ByVal page As Long) As Single
176 Public Declare Function HPDF_Page_GetTransMatrix Lib "libhpdf.dll" (ByVal page As Long) As HPDF_TransMatrix
177 Public Declare Function HPDF_Page_GetLineWidth Lib "libhpdf.dll" (ByVal page As Long) As Single
178 Public Declare Function HPDF_Page_GetLineCap Lib "libhpdf.dll" (ByVal page As Long) As HPDF_LineCap
179 Public Declare Function HPDF_Page_GetLineJoin Lib "libhpdf.dll" (ByVal page As Long) As HPDF_LineJoin
180 Public Declare Function HPDF_Page_GetMiterLimit Lib "libhpdf.dll" (ByVal page As Long) As Single
181 Public Declare Function HPDF_Page_GetDash Lib "libhpdf.dll" (ByVal page As Long) As HPDF_DashMode
182 Public Declare Function HPDF_Page_GetFlat Lib "libhpdf.dll" (ByVal page As Long) As Single
183 Public Declare Function HPDF_Page_GetCharSpace Lib "libhpdf.dll" (ByVal page As Long) As Single
184 Public Declare Function HPDF_Page_GetWordSpace Lib "libhpdf.dll" (ByVal page As Long) As Single
185 Public Declare Function HPDF_Page_GetHorizontalScalling Lib "libhpdf.dll" (ByVal page As Long) As Single
186 Public Declare Function HPDF_Page_GetTextLeading Lib "libhpdf.dll" (ByVal page As Long) As Single
187 Public Declare Function HPDF_Page_GetTextRenderingMode Lib "libhpdf.dll" (ByVal page As Long) As HPDF_TextRenderingMode
188 '/* This function is obsolete. Use HPDF_Page_GetTextRise.  */
189 Public Declare Function HPDF_Page_GetTextRaise Lib "libhpdf.dll" (ByVal page As Long) As Single
190 Public Declare Function HPDF_Page_GetTextRise Lib "libhpdf.dll" (ByVal page As Long) As Single
191 Public Declare Function HPDF_Page_GetRGBFill Lib "libhpdf.dll" (ByVal page As Long) As HPDF_RGBColor
192 Public Declare Function HPDF_Pageg_GetRGBStroke Lib "libhpdf.dll" (ByVal page As Long) As HPDF_RGBColor
193 Public Declare Function HPDF_Page_GetCMYKFill Lib "libhpdf.dll" (ByVal page As Long) As HPDF_CMYKColor
194 Public Declare Function HPDF_Page_GetCMYKStroke Lib "libhpdf.dll" (ByVal page As Long) As HPDF_CMYKColor
195 Public Declare Function HPDF_Page_GetGrayFill Lib "libhpdf.dll" (ByVal page As Long) As Single
196 Public Declare Function HPDF_Page_GetGrayStroke Lib "libhpdf.dll" (ByVal page As Long) As Single
197 Public Declare Function HPDF_Page_GetStrokingColorSpace Lib "libhpdf.dll" (ByVal page As Long) As HPDF_ColorSpace
198 Public Declare Function HPDF_Page_GetFillingColorSpace Lib "libhpdf.dll" (ByVal page As Long) As HPDF_ColorSpace
199 Public Declare Function HPDF_Page_GetTextMatrix Lib "libhpdf.dll" (ByVal page As Long) As HPDF_TransMatrix
200 Public Declare Function HPDF_Page_GetGStateDepth Lib "libhpdf.dll" (ByVal page As Long) As Long
201 '/*--------------------------------------------------------------------------*/
202 '/*----- GRAPHICS OPERATORS -------------------------------------------------*/
203 '/*--- General graphics state ---------------------------------------------*/
204 '/* w */
205 Public Declare Function HPDF_Page_SetLineWidth Lib "libhpdf.dll" (ByVal page As Long, ByVal line_width As Single) As Long
206 '/* J */
207 Public Declare Function HPDF_Page_SetLineCap Lib "libhpdf.dll" (ByVal page As Long, ByVal line_cap As HPDF_LineCap) As Long
208 '/* j */
209 Public Declare Function HPDF_Page_SetLineJoin Lib "libhpdf.dll" (ByVal page As Long, ByVal line_join As HPDF_LineJoin) As Long
210 '/* M */
211 Public Declare Function HPDF_Page_SetMiterLimit Lib "libhpdf.dll" (ByVal page As Long, ByVal miter_limit As Single) As Long
212 '/* d */
213 Public Declare Function HPDF_Page_SetDash Lib "libhpdf.dll" (ByVal page As Long, ByRef dash_ptn As Long, ByVal num_param As Long, ByVal phase As Long) As Long
214 '/* ri --not implemented yet */
215 '/* i */
216 Public Declare Function HPDF_Page_SetFlat Lib "libhpdf.dll" (ByVal page As Long, ByVal flatness As Single) As Long
217 '/* gs --not implemented yet */
218 '/*--- Special graphic state operator --------------------------------------*/
219 '/* q */
220 Public Declare Function HPDF_Page_GSave Lib "libhpdf.dll" (ByVal page As Long) As Long
221 '/* Q */
222 Public Declare Function HPDF_Page_GRestore Lib "libhpdf.dll" (ByVal page As Long) As Long
223 '/* cm */
224 Public Declare Function HPDF_Page_Concat Lib "libhpdf.dll" (ByVal page As Long, ByVal a As Single, ByVal b As Single, ByVal c As Single, ByVal d As Single, ByVal x As Single, ByVal y As Single) As Long
225 '/*--- Path construction operator ------------------------------------------*/
226 '/* m */
227 Public Declare Function HPDF_Page_MoveTo Lib "libhpdf.dll" (ByVal page As Long, ByVal x As Single, ByVal y As Single) As Long
228 '/* l */
229 Public Declare Function HPDF_Page_LineTo Lib "libhpdf.dll" (ByVal page As Long, ByVal x As Single, ByVal y As Single) As Long
230 '/* c */
231 Public Declare Function HPDF_Page_CurveTo Lib "libhpdf.dll" (ByVal page As Long, ByVal x1 As Single, ByVal y1 As Single, ByVal x2 As Single, ByVal y2 As Single, ByVal x3 As Single, ByVal y3 As Single) As Long
232 '/* v */
233 Public Declare Function HPDF_Page_CurveTo2 Lib "libhpdf.dll" (ByVal page As Long, ByVal x2 As Single, ByVal y2 As Single, ByVal x3 As Single, ByVal y3 As Single) As Long
234 '/* y */
235 Public Declare Function HPDF_Page_CurveTo3 Lib "libhpdf.dll" (ByVal page As Long, ByVal x1 As Single, ByVal y1 As Single, ByVal x3 As Single, ByVal y3 As Single) As Long
236 '/* h */
237 Public Declare Function HPDF_Page_ClosePath Lib "libhpdf.dll" (ByVal page As Long) As Long
238 '/* re */
239 Public Declare Function HPDF_Page_Rectangle Lib "libhpdf.dll" (ByVal page As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal height As Single) As Long
240 '/*--- Path painting operator ---------------------------------------------*/
241 '/* S */
242 Public Declare Function HPDF_Page_Stroke Lib "libhpdf.dll" (ByVal page As Long) As Long
243 '/* s */
244 Public Declare Function HPDF_Page_ClosePathStroke Lib "libhpdf.dll" (ByVal page As Long) As Long
245 '/* f */
246 Public Declare Function HPDF_Page_Fill Lib "libhpdf.dll" (ByVal page As Long) As Long
247 '/* f* */
248 Public Declare Function HPDF_Page_Eofill Lib "libhpdf.dll" (ByVal page As Long) As Long
249 '/* B */
250 Public Declare Function HPDF_Page_FillStroke Lib "libhpdf.dll" (ByVal page As Long) As Long
251 '/* B* */
252 Public Declare Function HPDF_Page_EofillStroke Lib "libhpdf.dll" (ByVal page As Long) As Long
253 '/* b */
254 Public Declare Function HPDF_Page_ClosePathFillStroke Lib "libhpdf.dll" (ByVal page As Long) As Long
255 '/* b* */
256 Public Declare Function HPDF_Page_ClosePathEofillStroke Lib "libhpdf.dll" (ByVal page As Long) As Long
257 '/* n */
258 Public Declare Function HPDF_Page_EndPath Lib "libhpdf.dll" (ByVal page As Long) As Long
259 '/*--- Clipping paths operator --------------------------------------------*/
260 '/* W */
261 Public Declare Function HPDF_Page_Clip Lib "libhpdf.dll" (ByVal page As Long) As Long
262 '/* W* */
263 Public Declare Function HPDF_Page_Eoclip Lib "libhpdf.dll" (ByVal page As Long) As Long
264 '/*--- Text object operator -----------------------------------------------*/
265 '/* BT */
266 Public Declare Function HPDF_Page_BeginText Lib "libhpdf.dll" (ByVal page As Long) As Long
267 '/* ET */
268 Public Declare Function HPDF_Page_EndText Lib "libhpdf.dll" (ByVal page As Long) As Long
269 '/*--- Text state ---------------------------------------------------------*/
270 '/* Tc */
271 Public Declare Function HPDF_Page_SetCharSpace Lib "libhpdf.dll" (ByVal page As Long, ByVal value As Single) As Long
272 '/* Tw */
273 Public Declare Function HPDF_Page_SetWordSpace Lib "libhpdf.dll" (ByVal page As Long, ByVal value As Single) As Long
274 '/* Tz */
275 Public Declare Function HPDF_Page_SetHorizontalScalling Lib "libhpdf.dll" (ByVal page As Long, ByVal value As Single) As Long
276 '/* TL */
277 Public Declare Function HPDF_Page_SetTextLeading Lib "libhpdf.dll" (ByVal page As Long, ByVal value As Single) As Long
278 '/* Tf */
279 Public Declare Function HPDF_Page_SetFontAndSize Lib "libhpdf.dll" (ByVal page As Long, ByVal font As Long, ByVal Size As Single) As Long
280 '/* Tr */
281 Public Declare Function HPDF_Page_SetTextRenderingMode Lib "libhpdf.dll" (ByVal page As Long, ByVal mode As HPDF_TextRenderingMode) As Long
282 '/* Ts */
283 Public Declare Function HPDF_Page_SetTextRise Lib "libhpdf.dll" (ByVal page As Long, ByVal value As Single) As Long
284 '/* This function is obsolete. Use HPDF_Page_SetTextRise.  */
285 Public Declare Function HPDF_Page_SetTextRaise Lib "libhpdf.dll" (ByVal page As Long, ByVal value As Single) As Long
286 '/*--- Text positioning ---------------------------------------------------*/
287 '/* Td */
288 Public Declare Function HPDF_Page_MoveTextPos Lib "libhpdf.dll" (ByVal page As Long, ByVal x As Single, ByVal y As Single) As Long
289 '/* TD */
290 Public Declare Function HPDF_Page_MoveTextPos2 Lib "libhpdf.dll" (ByVal page As Long, ByVal x As Single, ByVal y As Single) As Long
291 '/* Tm */
292 Public Declare Function HPDF_Page_SetTextMatrix Lib "libhpdf.dll" (ByVal page As Long, ByVal a As Single, ByVal b As Single, ByVal c As Single, ByVal d As Single, ByVal x As Single, ByVal y As Single) As Long
293 '/* T* */
294 Public Declare Function HPDF_Page_MoveToNextLine Lib "libhpdf.dll" (ByVal page As Long) As Long
295 '/*--- Text showing -------------------------------------------------------*/
296 '/* Tj */
297 Public Declare Function HPDF_Page_ShowText Lib "libhpdf.dll" (ByVal page As Long, ByVal text As String) As Long
298 '/* TJ */
299 '/* ' */
300 Public Declare Function HPDF_Page_ShowTextNextLine Lib "libhpdf.dll" (ByVal page As Long, ByVal text As String) As Long
301 '/* " */
302 Public Declare Function HPDF_Page_ShowTextNextLineEx Lib "libhpdf.dll" (ByVal page As Long, ByVal word_space As Single, ByVal char_space As Single, ByVal text As String) As Long
303 '/*--- Color showing ------------------------------------------------------*/
304
305 '/* cs --not implemented yet */
306 '/* CS --not implemented yet */
307 '/* sc --not implemented yet */
308 '/* scn --not implemented yet */
309 '/* SC --not implemented yet */
310 '/* SCN --not implemented yet */
311
312 '/* g */
313 Public Declare Function HPDF_Page_SetGrayFill Lib "libhpdf.dll" (ByVal page As Long, ByVal gray As Single) As Long
314 '/* G */
315 Public Declare Function HPDF_Page_SetGrayStroke Lib "libhpdf.dll" (ByVal page As Long, ByVal gray As Single) As Long
316 '/* rg */
317 Public Declare Function HPDF_Page_SetRGBFill Lib "libhpdf.dll" (ByVal page As Long, ByVal r As Single, ByVal g As Single, ByVal b As Single) As Long
318 '/* RG */
319 Public Declare Function HPDF_Page_SetRGBStroke Lib "libhpdf.dll" (ByVal page As Long, ByVal r As Single, ByVal g As Single, ByVal b As Single) As Long
320 '/* k */
321 Public Declare Function HPDF_Page_SetCMYKFill Lib "libhpdf.dll" (ByVal page As Long, ByVal c As Single, ByVal m As Single, ByVal y As Single, ByVal k As Single) As Long
322 '/* K */
323 Public Declare Function HPDF_Page_SetCMYKStroke Lib "libhpdf.dll" (ByVal page As Long, ByVal c As Single, ByVal m As Single, ByVal y As Single, ByVal k As Single) As Long
324 '/*--- Shading patterns ---------------------------------------------------*/
325 '/* sh --not implemented yet */
326 '/*--- In-line images -----------------------------------------------------*/
327 '/* BI --not implemented yet */
328 '/* ID --not implemented yet */
329 '/* EI --not implemented yet */
330 '/*--- XObjects -----------------------------------------------------------*/
331 '/* Do */
332 Public Declare Function HPDF_Page_ExecuteXObject Lib "libhpdf.dll" (ByVal page As Long, obj As Long) As Long
333 '/*--- Marked content -----------------------------------------------------*/
334 '/* BMC --not implemented yet */
335 '/* BDC --not implemented yet */
336 '/* EMC --not implemented yet */
337 '/* MP --not implemented yet */
338 '/* DP --not implemented yet */
339 '/*--- Compatibility ------------------------------------------------------*/
340 '/* BX --not implemented yet */
341 '/* EX --not implemented yet */
342 Public Declare Function HPDF_Page_DrawImage Lib "libhpdf.dll" (ByVal page As Long, ByVal image As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal height As Single) As Long
343 Public Declare Function HPDF_Page_Circle Lib "libhpdf.dll" (ByVal page As Long, ByVal x As Single, ByVal y As Single, ByVal ray As Single) As Long
344 Public Declare Function HPDF_Page_Ellipse Lib "libhpdf.dll" (ByVal page As Long, ByVal x As Single, ByVal y As Single, ByVal xray As Single, 
345  ByVal yray As Single) As Long
346 Public Declare Function HPDF_Page_Arc Lib "libhpdf.dll" (ByVal page As Long, ByVal x As Single, ByVal y As Single, ByVal ray As Single, ByVal ang1 As Single, ByVal ang2 As Single) As Long
347 Public Declare Function HPDF_Page_TextOut Lib "libhpdf.dll" (ByVal page As Long, ByVal xpos As Single, ByVal ypos As Single, ByVal text As String) As Long
348 Public Declare Function HPDF_Page_TextRect Lib "libhpdf.dll" (ByVal page As Long, ByVal Left As Single, ByVal top As Single, ByVal Right As Single, ByVal bottom As Single, ByVal text As String, ByVal align As Long, ByRef length As Long) As Long
349
350
351 Public Sub error_handler(ByVal error_no As Long, ByVal detail_no As Long, ByVal user_data As String)
352     Debug.Print "ERROR: error_no=" & error_no & ", detail_no="; detail_no
353     'longjmp(env, 1)
354 End Sub
355