Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(863)

Side by Side Diff: fpdfsdk/include/fpdftext.h

Issue 453133004: clang-format all code (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef _FPDFTEXT_H_ 7 #ifndef _FPDFTEXT_H_
8 #define _FPDFTEXT_H_ 8 #define _FPDFTEXT_H_
9 9
10 #include "fpdfview.h" 10 #include "fpdfview.h"
11 11
12 // Exported Functions 12 // Exported Functions
13 #ifdef __cplusplus 13 #ifdef __cplusplus
14 extern "C" { 14 extern "C" {
15 #endif 15 #endif
16 16
17 // Function: FPDFText_LoadPage 17 // Function: FPDFText_LoadPage
18 // Prepare information about all characters in a page. 18 // Prepare information about all characters in a page.
19 // Parameters: 19 // Parameters:
20 //» » » page» -» Handle to the page. Returned by FPDF_Loa dPage function (in FPDFVIEW module).» 20 //» » » page» -» Handle to the page. Returned by
21 //FPDF_LoadPage function (in FPDFVIEW module).
21 // Return value: 22 // Return value:
22 // A handle to the text page information structure. 23 // A handle to the text page information structure.
23 // NULL if something goes wrong. 24 // NULL if something goes wrong.
24 // Comments: 25 // Comments:
25 //» » » Application must call FPDFText_ClosePage to release the text page information. 26 //» » » Application must call FPDFText_ClosePage to release the text
26 //» » » If you don't purchase Text Module , this function will r eturn NULL. 27 //page information.
27 //» 28 //» » » If you don't purchase Text Module , this function will
28 DLLEXPORT FPDF_TEXTPAGE»STDCALL FPDFText_LoadPage(FPDF_PAGE page); 29 //return NULL.
30 //
31 DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page);
29 32
30 // Function: FPDFText_ClosePage 33 // Function: FPDFText_ClosePage
31 //» » » Release all resources allocated for a text page informat ion structure. 34 //» » » Release all resources allocated for a text page informat ion
32 // Parameters: 35 //structure.
33 //» » » text_page» -» Handle to a text page informatio n structure. Returned by FPDFText_LoadPage function. 36 // Parameters:
37 //» » » text_page» -» Handle to a text page informatio n
38 //structure. Returned by FPDFText_LoadPage function.
34 // Return Value: 39 // Return Value:
35 // None. 40 // None.
36 // 41 //
37 DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page); 42 DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page);
38 » 43
39 // Function: FPDFText_CountChars 44 // Function: FPDFText_CountChars
40 // Get number of characters in a page. 45 // Get number of characters in a page.
41 // Parameters: 46 // Parameters:
42 //» » » text_page» -» Handle to a text page informatio n structure. Returned by FPDFText_LoadPage function. 47 //» » » text_page» -» Handle to a text page informatio n
43 // Return value: 48 //structure. Returned by FPDFText_LoadPage function.
44 //» » » Number of characters in the page. Return -1 for error. 49 // Return value:
45 //» » » Generated characters, like additional space characters, new line characters, are also counted. 50 //» » » Number of characters in the page. Return -1 for error.
46 // Comments: 51 //» » » Generated characters, like additional space characters, new
47 //» » » Characters in a page form a "stream", inside the stream, each character has an index. 52 //line characters, are also counted.
48 //» » » We will use the index parameters in many of FPDFTEXT fun ctions. The first character in the page 53 // Comments:
54 //» » » Characters in a page form a "stream", inside the stream,
55 //each character has an index.
56 //» » » We will use the index parameters in many of FPDFTEXT
57 //functions. The first character in the page
49 // has an index value of zero. 58 // has an index value of zero.
50 // 59 //
51 DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page); 60 DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page);
52 61
53 // Function: FPDFText_GetUnicode 62 // Function: FPDFText_GetUnicode
54 // Get Unicode of a character in a page. 63 // Get Unicode of a character in a page.
55 // Parameters: 64 // Parameters:
56 //» » » text_page» -» Handle to a text page informatio n structure. Returned by FPDFText_LoadPage function. 65 //» » » text_page» -» Handle to a text page informatio n
57 //» » » index» » -» Zero-based index of the characte r. 66 //structure. Returned by FPDFText_LoadPage function.
67 //» » » index» » -» Zero-based index of the
68 //character.
58 // Return value: 69 // Return value:
59 // The Unicode of the particular character. 70 // The Unicode of the particular character.
60 //» » » If a character is not encoded in Unicode and Foxit engin e can't convert to Unicode, 71 //» » » If a character is not encoded in Unicode and Foxit engin e
72 //can't convert to Unicode,
61 // the return value will be zero. 73 // the return value will be zero.
62 // 74 //
63 DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index); 75 DLLEXPORT unsigned int STDCALL
76 FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index);
64 77
65 // Function: FPDFText_GetFontSize 78 // Function: FPDFText_GetFontSize
66 // Get the font size of a particular character. 79 // Get the font size of a particular character.
67 // Parameters: 80 // Parameters:
68 //» » » text_page» -» Handle to a text page informatio n structure. Returned by FPDFText_LoadPage function. 81 //» » » text_page» -» Handle to a text page informatio n
69 //» » » index» » -» Zero-based index of the characte r. 82 //structure. Returned by FPDFText_LoadPage function.
70 // Return value: 83 //» » » index» » -» Zero-based index of the
71 //» » » The font size of the particular character, measured in p oints (about 1/72 inch). 84 //character.
72 //» » » This is the typographic size of the font (so called "em size"). 85 // Return value:
73 // 86 //» » » The font size of the particular character, measured in
74 DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, int index ); 87 //points (about 1/72 inch).
88 //» » » This is the typographic size of the font (so called "em
89 //size").
90 //
91 DLLEXPORT double STDCALL
92 FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, int index);
75 93
76 // Function: FPDFText_GetCharBox 94 // Function: FPDFText_GetCharBox
77 // Get bounding box of a particular character. 95 // Get bounding box of a particular character.
78 // Parameters: 96 // Parameters:
79 //» » » text_page» -» Handle to a text page informatio n structure. Returned by FPDFText_LoadPage function. 97 //» » » text_page» -» Handle to a text page informatio n
80 //» » » index» » -» Zero-based index of the characte r. 98 //structure. Returned by FPDFText_LoadPage function.
81 //» » » left» » -» Pointer to a double number recei ving left position of the character box. 99 //» » » index» » -» Zero-based index of the
82 //» » » right» » -» Pointer to a double number recei ving right position of the character box. 100 //character.
83 //» » » bottom» » -» Pointer to a double number recei ving bottom position of the character box. 101 //» » » left» » -» Pointer to a double number recei ving
84 //» » » top» » » -» Pointer to a double numb er receiving top position of the character box. 102 //left position of the character box.
103 //» » » right» » -» Pointer to a double number recei ving
104 //right position of the character box.
105 //» » » bottom» » -» Pointer to a double number
106 //receiving bottom position of the character box.
107 //» » » top» » » -» Pointer to a double numb er
108 //receiving top position of the character box.
85 // Return Value: 109 // Return Value:
86 // None. 110 // None.
87 // Comments: 111 // Comments:
88 // All positions are measured in PDF "user space". 112 // All positions are measured in PDF "user space".
89 // 113 //
90 DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, int index, d ouble* left, 114 DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page,
91 » » » » » » » » » » » » » double* right, double* bottom, double* top); 115 int index,
116 double* left,
117 double* right,
118 double* bottom,
119 double* top);
92 120
93 // Function: FPDFText_GetCharIndexAtPos 121 // Function: FPDFText_GetCharIndexAtPos
94 //» » » Get the index of a character at or nearby a certain posi tion on the page. 122 //» » » Get the index of a character at or nearby a certain posi tion
95 // Parameters: 123 //on the page.
96 //» » » text_page» -» Handle to a text page informatio n structure. Returned by FPDFText_LoadPage function. 124 // Parameters:
97 //» » » x» » » -» X position in PDF "user space". 125 //» » » text_page» -» Handle to a text page informatio n
98 //» » » y» » » -» Y position in PDF "user space". 126 //structure. Returned by FPDFText_LoadPage function.
99 //» » » xTolerance» -» An x-axis tolerance value for ch aracter hit detection, in point unit. 127 //» » » x» » » -» X position in PDF "user
100 //» » » yTolerance» -» A y-axis tolerance value for cha racter hit detection, in point unit. 128 //space".
101 // Return Value: 129 //» » » y» » » -» Y position in PDF "user
102 //» » » The zero-based index of the character at, or nearby the point (x,y). 130 //space".
103 //» » » If there is no character at or nearby the point, return value will be -1. 131 //» » » xTolerance» -» An x-axis tolerance value for
132 //character hit detection, in point unit.
133 //» » » yTolerance» -» A y-axis tolerance value for
134 //character hit detection, in point unit.
135 // Return Value:
136 //» » » The zero-based index of the character at, or nearby the
137 //point (x,y).
138 //» » » If there is no character at or nearby the point, return
139 //value will be -1.
104 // If an error occurs, -3 will be returned. 140 // If an error occurs, -3 will be returned.
105 // 141 //
106 DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page, 142 DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
107 » » » » » » » » » » » » double x, double y, double xTorelance, double yTolerance); 143 double x,
144 double y,
145 double xTorelance,
146 double yTolerance);
108 147
109 // Function: FPDFText_GetText 148 // Function: FPDFText_GetText
110 // Extract unicode text string from the page. 149 // Extract unicode text string from the page.
111 // Parameters: 150 // Parameters:
112 //» » » text_page» -» Handle to a text page informatio n structure. Returned by FPDFText_LoadPage function. 151 //» » » text_page» -» Handle to a text page informatio n
152 //structure. Returned by FPDFText_LoadPage function.
113 // start_index - Index for the start characters. 153 // start_index - Index for the start characters.
114 //» » » count» » -» Number of characters to be extra cted. 154 //» » » count» » -» Number of characters to be
115 //» » » result» » -» A buffer (allocated by applicati on) receiving the extracted unicodes. 155 //extracted.
116 //» » » » » » » The size of the buffer m ust be able to hold the number of characters plus a terminator. 156 //» » » result» » -» A buffer (allocated by applicati on)
117 // Return Value: 157 //receiving the extracted unicodes.
118 //» » » Number of characters written into the result buffer, inc luding the trailing terminator. 158 //» » » » » » » The size of the buffer m ust be able
119 // Comments: 159 //to hold the number of characters plus a terminator.
120 //» » » This function ignores characters without unicode informa tion. 160 // Return Value:
121 //» » » 161 //» » » Number of characters written into the result buffer,
122 DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page, int start_index, int count, unsigned short* result); 162 //including the trailing terminator.
163 // Comments:
164 //» » » This function ignores characters without unicode
165 //information.
166 //
167 DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page,
168 int start_index,
169 int count,
170 unsigned short* result);
123 171
124 // Function: FPDFText_CountRects 172 // Function: FPDFText_CountRects
125 //» » » Count number of rectangular areas occupied by a segment of texts. 173 //» » » Count number of rectangular areas occupied by a segment of
126 // Parameters: 174 //texts.
127 //» » » text_page» -» Handle to a text page informatio n structure. Returned by FPDFText_LoadPage function. 175 // Parameters:
176 //» » » text_page» -» Handle to a text page informatio n
177 //structure. Returned by FPDFText_LoadPage function.
128 // start_index - Index for the start characters. 178 // start_index - Index for the start characters.
129 // count - Number of characters. 179 // count - Number of characters.
130 // Return value: 180 // Return value:
131 // Number of rectangles. Zero for error. 181 // Number of rectangles. Zero for error.
132 // Comments: 182 // Comments:
133 //» » » This function, along with FPDFText_GetRect can be used b y applications to detect the position 183 //» » » This function, along with FPDFText_GetRect can be used b y
134 //» » » on the page for a text segment, so proper areas can be h ighlighted or something. 184 //applications to detect the position
135 //» » » FPDFTEXT will automatically merge small character boxes into bigger one if those characters 185 //» » » on the page for a text segment, so proper areas can be
186 //highlighted or something.
187 //» » » FPDFTEXT will automatically merge small character boxes into
188 //bigger one if those characters
136 // are on the same line and use same font settings. 189 // are on the same line and use same font settings.
137 // 190 //
138 DLLEXPORT int STDCALL FPDFText_CountRects(FPDF_TEXTPAGE text_page, int start_ind ex, int count); 191 DLLEXPORT int STDCALL
192 FPDFText_CountRects(FPDF_TEXTPAGE text_page, int start_index, int count);
139 193
140 // Function: FPDFText_GetRect 194 // Function: FPDFText_GetRect
141 //» » » Get a rectangular area from the result generated by FPDF Text_CountRects. 195 //» » » Get a rectangular area from the result generated by
142 // Parameters: 196 //FPDFText_CountRects.
143 //» » » text_page» -» Handle to a text page informatio n structure. Returned by FPDFText_LoadPage function. 197 // Parameters:
144 //» » » rect_index» -» Zero-based index for the rectang le. 198 //» » » text_page» -» Handle to a text page informatio n
145 //» » » left» » -» Pointer to a double value receiv ing the rectangle left boundary. 199 //structure. Returned by FPDFText_LoadPage function.
146 //» » » top» » » -» Pointer to a double valu e receiving the rectangle top boundary. 200 //» » » rect_index» -» Zero-based index for the
147 //» » » right» » -» Pointer to a double value receiv ing the rectangle right boundary. 201 //rectangle.
148 //» » » bottom» » -» Pointer to a double value receiv ing the rectangle bottom boundary. 202 //» » » left» » -» Pointer to a double value receiv ing
203 //the rectangle left boundary.
204 //» » » top» » » -» Pointer to a double valu e
205 //receiving the rectangle top boundary.
206 //» » » right» » -» Pointer to a double value receiv ing
207 //the rectangle right boundary.
208 //» » » bottom» » -» Pointer to a double value receiv ing
209 //the rectangle bottom boundary.
149 // Return Value: 210 // Return Value:
150 // None. 211 // None.
151 // 212 //
152 DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page, int rect_index, double* left, double* top, 213 DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page,
153 » » » » » » » » » » » double* right, double* bottom); 214 int rect_index,
215 double* left,
216 double* top,
217 double* right,
218 double* bottom);
154 219
155 // Function: FPDFText_GetBoundedText 220 // Function: FPDFText_GetBoundedText
156 //» » » Extract unicode text within a rectangular boundary on th e page. 221 //» » » Extract unicode text within a rectangular boundary on th e
157 // Parameters: 222 //page.
158 //» » » text_page» -» Handle to a text page informatio n structure. Returned by FPDFText_LoadPage function. 223 // Parameters:
224 //» » » text_page» -» Handle to a text page informatio n
225 //structure. Returned by FPDFText_LoadPage function.
159 // left - Left boundary. 226 // left - Left boundary.
160 // top - Top boundary. 227 // top - Top boundary.
161 // right - Right boundary. 228 // right - Right boundary.
162 // bottom - Bottom boundary. 229 // bottom - Bottom boundary.
163 // buffer - A unicode buffer. 230 // buffer - A unicode buffer.
164 //» » » buflen» » -» Number of characters (not bytes) for the buffer, excluding an additional terminator. 231 //» » » buflen» » -» Number of characters (not bytes)
165 // Return Value: 232 //for the buffer, excluding an additional terminator.
166 //» » » If buffer is NULL or buflen is zero, return number of ch aracters (not bytes) needed, 233 // Return Value:
167 //» » » otherwise, return number of characters copied into the b uffer. 234 //» » » If buffer is NULL or buflen is zero, return number of
168 // 235 //characters (not bytes) needed,
169 DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,double lef t, double top, 236 //» » » otherwise, return number of characters copied into the
170 » » » » » » » » » » » double right, double bottom,unsigned short* buffer,int buflen); 237 //buffer.
171 238 //
239 DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,
240 double left,
241 double top,
242 double right,
243 double bottom,
244 unsigned short* buffer,
245 int buflen);
172 246
173 // Flags used by FPDFText_FindStart function. 247 // Flags used by FPDFText_FindStart function.
174 #define FPDF_MATCHCASE 0x00000001» » //If not set, it will not match case by default. 248 #define FPDF_MATCHCASE \
175 #define FPDF_MATCHWHOLEWORD 0x00000002» » //If not set, it will not match the whole word by default. 249 0x00000001 // If not set, it will not match case by default.
250 #define FPDF_MATCHWHOLEWORD \
251 0x00000002 // If not set, it will not match the whole word by default.
176 252
177 // Function: FPDFText_FindStart 253 // Function: FPDFText_FindStart
178 // Start a search. 254 // Start a search.
179 // Parameters: 255 // Parameters:
180 //» » » text_page» -» Handle to a text page informatio n structure. Returned by FPDFText_LoadPage function. 256 //» » » text_page» -» Handle to a text page informatio n
257 //structure. Returned by FPDFText_LoadPage function.
181 // findwhat - A unicode match pattern. 258 // findwhat - A unicode match pattern.
182 // flags - Option flags. 259 // flags - Option flags.
183 //» » » start_index» -» Start from this character. -1 fo r end of the page. 260 //» » » start_index» -» Start from this character. -1 fo r
184 // Return Value: 261 //end of the page.
185 //» » » A handle for the search context. FPDFText_FindClose must be called to release this handle. 262 // Return Value:
186 // 263 //» » » A handle for the search context. FPDFText_FindClose must be
187 DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page, FPD F_WIDESTRING findwhat, 264 //called to release this handle.
188 » » » » » » » » » » » » » unsigned long flags, int start_index); 265 //
266 DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page,
267 FPDF_WIDESTRING findwhat,
268 unsigned long flags,
269 int start_index);
189 270
190 // Function: FPDFText_FindNext 271 // Function: FPDFText_FindNext
191 // Search in the direction from page start to end. 272 // Search in the direction from page start to end.
192 // Parameters: 273 // Parameters:
193 //» » » handle» » -» A search context handle returned by FPDFText_FindStart. 274 //» » » handle» » -» A search context handle returned by
275 //FPDFText_FindStart.
194 // Return Value: 276 // Return Value:
195 // Whether a match is found. 277 // Whether a match is found.
196 // 278 //
197 DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle); 279 DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle);
198 280
199 // Function: FPDFText_FindPrev 281 // Function: FPDFText_FindPrev
200 // Search in the direction from page end to start. 282 // Search in the direction from page end to start.
201 // Parameters: 283 // Parameters:
202 //» » » handle» » -» A search context handle returned by FPDFText_FindStart. 284 //» » » handle» » -» A search context handle returned by
285 //FPDFText_FindStart.
203 // Return Value: 286 // Return Value:
204 // Whether a match is found. 287 // Whether a match is found.
205 // 288 //
206 DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle); 289 DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle);
207 290
208 // Function: FPDFText_GetSchResultIndex 291 // Function: FPDFText_GetSchResultIndex
209 // Get the starting character index of the search result. 292 // Get the starting character index of the search result.
210 // Parameters: 293 // Parameters:
211 //» » » handle» » -» A search context handle returned by FPDFText_FindStart. 294 //» » » handle» » -» A search context handle returned by
295 //FPDFText_FindStart.
212 // Return Value: 296 // Return Value:
213 // Index for the starting character. 297 // Index for the starting character.
214 // 298 //
215 DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle); 299 DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle);
216 300
217 // Function: FPDFText_GetSchCount 301 // Function: FPDFText_GetSchCount
218 //» » » Get the number of matched characters in the search resul t. 302 //» » » Get the number of matched characters in the search
303 //result.
219 // Parameters: 304 // Parameters:
220 //» » » handle» » -» A search context handle returned by FPDFText_FindStart. 305 //» » » handle» » -» A search context handle returned by
306 //FPDFText_FindStart.
221 // Return Value: 307 // Return Value:
222 // Number of matched characters. 308 // Number of matched characters.
223 // 309 //
224 DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle); 310 DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle);
225 311
226 // Function: FPDFText_FindClose 312 // Function: FPDFText_FindClose
227 // Release a search context. 313 // Release a search context.
228 // Parameters: 314 // Parameters:
229 //» » » handle» » -» A search context handle returned by FPDFText_FindStart. 315 //» » » handle» » -» A search context handle returned by
316 //FPDFText_FindStart.
230 // Return Value: 317 // Return Value:
231 // None. 318 // None.
232 // 319 //
233 DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle); 320 DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle);
234 321
235 // Function: FPDFLink_LoadWebLinks 322 // Function: FPDFLink_LoadWebLinks
236 // Prepare information about weblinks in a page. 323 // Prepare information about weblinks in a page.
237 // Parameters: 324 // Parameters:
238 //» » » text_page» -» Handle to a text page informatio n structure. Returned by FPDFText_LoadPage function. 325 //» » » text_page» -» Handle to a text page informatio n
239 // Return Value:» 326 //structure. Returned by FPDFText_LoadPage function.
327 // Return Value:
240 // A handle to the page's links information structure. 328 // A handle to the page's links information structure.
241 // NULL if something goes wrong. 329 // NULL if something goes wrong.
242 // Comments: 330 // Comments:
243 //» » » Weblinks are those links implicitly embedded in PDF page s. PDF also has a type of 331 //» » » Weblinks are those links implicitly embedded in PDF page s.
244 //» » » annotation called "link", FPDFTEXT doesn't deal with tha t kind of link. 332 //PDF also has a type of
245 //» » » FPDFTEXT weblink feature is useful for automatically det ecting links in the page 333 //» » » annotation called "link", FPDFTEXT doesn't deal with tha t
246 //» » » contents. For example, things like "http://www.foxitsoft ware.com" will be detected, 334 //kind of link.
247 //» » » so applications can allow user to click on those charact ers to activate the link, 335 //» » » FPDFTEXT weblink feature is useful for automatically
336 //detecting links in the page
337 //» » » contents. For example, things like
338 //"http://www.foxitsoftware.com" will be detected,
339 //» » » so applications can allow user to click on those charact ers
340 //to activate the link,
248 // even the PDF doesn't come with link annotations. 341 // even the PDF doesn't come with link annotations.
249 // 342 //
250 //» » » FPDFLink_CloseWebLinks must be called to release resourc es. 343 //» » » FPDFLink_CloseWebLinks must be called to release
344 //resources.
251 // 345 //
252 DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page); 346 DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page);
253 347
254 // Function: FPDFLink_CountWebLinks 348 // Function: FPDFLink_CountWebLinks
255 // Count number of detected web links. 349 // Count number of detected web links.
256 // Parameters: 350 // Parameters:
257 //» » » link_page» -» Handle returned by FPDFLink_Load WebLinks. 351 //» » » link_page» -» Handle returned by
352 //FPDFLink_LoadWebLinks.
258 // Return Value: 353 // Return Value:
259 // Number of detected web links. 354 // Number of detected web links.
260 // 355 //
261 DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page); 356 DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page);
262 357
263 // Function: FPDFLink_GetURL 358 // Function: FPDFLink_GetURL
264 // Fetch the URL information for a detected web link. 359 // Fetch the URL information for a detected web link.
265 // Parameters: 360 // Parameters:
266 //» » » link_page» -» Handle returned by FPDFLink_Load WebLinks. 361 //» » » link_page» -» Handle returned by
362 //FPDFLink_LoadWebLinks.
267 // link_index - Zero-based index for the link. 363 // link_index - Zero-based index for the link.
268 // buffer - A unicode buffer. 364 // buffer - A unicode buffer.
269 //» » » buflen» » -» Number of characters (not bytes) for the buffer, including an additional terminator. 365 //» » » buflen» » -» Number of characters (not bytes)
366 //for the buffer, including an additional terminator.
270 // Return Value: 367 // Return Value:
271 //» » » If buffer is NULL or buflen is zero, return number of ch aracters (not bytes and an additional terminator is also counted) needed, 368 //» » » If buffer is NULL or buflen is zero, return number of
272 //» » » otherwise, return number of characters copied into the b uffer. 369 //characters (not bytes and an additional terminator is also counted) needed,
370 //» » » otherwise, return number of characters copied into the
371 //buffer.
273 // 372 //
274 DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page, int link_index, u nsigned short* buffer,int buflen); 373 DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page,
374 int link_index,
375 unsigned short* buffer,
376 int buflen);
275 377
276 // Function: FPDFLink_CountRects 378 // Function: FPDFLink_CountRects
277 // Count number of rectangular areas for the link. 379 // Count number of rectangular areas for the link.
278 // Parameters: 380 // Parameters:
279 //» » » link_page» -» Handle returned by FPDFLink_Load WebLinks. 381 //» » » link_page» -» Handle returned by
382 //FPDFLink_LoadWebLinks.
280 // link_index - Zero-based index for the link. 383 // link_index - Zero-based index for the link.
281 // Return Value: 384 // Return Value:
282 // Number of rectangular areas for the link. 385 // Number of rectangular areas for the link.
283 // 386 //
284 DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page, int link_inde x); 387 DLLEXPORT int STDCALL
388 FPDFLink_CountRects(FPDF_PAGELINK link_page, int link_index);
285 389
286 // Function: FPDFLink_GetRect 390 // Function: FPDFLink_GetRect
287 // Fetch the boundaries of a rectangle for a link. 391 // Fetch the boundaries of a rectangle for a link.
288 // Parameters: 392 // Parameters:
289 //» » » link_page» -» Handle returned by FPDFLink_Load WebLinks. 393 //» » » link_page» -» Handle returned by
394 //FPDFLink_LoadWebLinks.
290 // link_index - Zero-based index for the link. 395 // link_index - Zero-based index for the link.
291 //» » » rect_index» -» Zero-based index for a rectangle . 396 //» » » rect_index» -» Zero-based index for a
292 //» » » left» » -» Pointer to a double value receiv ing the rectangle left boundary. 397 //rectangle.
293 //» » » top» » » -» Pointer to a double valu e receiving the rectangle top boundary. 398 //» » » left» » -» Pointer to a double value receiv ing
294 //» » » right» » -» Pointer to a double value receiv ing the rectangle right boundary. 399 //the rectangle left boundary.
295 //» » » bottom» » -» Pointer to a double value receiv ing the rectangle bottom boundary. 400 //» » » top» » » -» Pointer to a double valu e
401 //receiving the rectangle top boundary.
402 //» » » right» » -» Pointer to a double value receiv ing
403 //the rectangle right boundary.
404 //» » » bottom» » -» Pointer to a double value receiv ing
405 //the rectangle bottom boundary.
296 // Return Value: 406 // Return Value:
297 // None. 407 // None.
298 // 408 //
299 DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page, int link_index, int rect_index, 409 DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page,
300 » » » » » » » » » » double* left, double* top,double* right, double* bottom); 410 int link_index,
411 int rect_index,
412 double* left,
413 double* top,
414 double* right,
415 double* bottom);
301 416
302 // Function: FPDFLink_CloseWebLinks 417 // Function: FPDFLink_CloseWebLinks
303 // Release resources used by weblink feature. 418 // Release resources used by weblink feature.
304 // Parameters: 419 // Parameters:
305 //» » » link_page» -» Handle returned by FPDFLink_Load WebLinks. 420 //» » » link_page» -» Handle returned by
421 //FPDFLink_LoadWebLinks.
306 // Return Value: 422 // Return Value:
307 // None. 423 // None.
308 // 424 //
309 DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page); 425 DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page);
310 426
311
312 #ifdef __cplusplus 427 #ifdef __cplusplus
313 }; 428 };
314 #endif 429 #endif
315 430
316 #endif//_FPDFTEXT_H_ 431 #endif //_FPDFTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698