OLD | NEW |
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 PUBLIC_FPDF_EDIT_H_ | 7 #ifndef PUBLIC_FPDF_EDIT_H_ |
8 #define PUBLIC_FPDF_EDIT_H_ | 8 #define PUBLIC_FPDF_EDIT_H_ |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 22 matching lines...) Expand all Loading... |
33 // Document functions | 33 // Document functions |
34 // | 34 // |
35 ////////////////////////////////////////////////////////////////////// | 35 ////////////////////////////////////////////////////////////////////// |
36 | 36 |
37 // Function: FPDF_CreateNewDocument | 37 // Function: FPDF_CreateNewDocument |
38 // Create a new PDF document. | 38 // Create a new PDF document. |
39 // Parameters: | 39 // Parameters: |
40 // None. | 40 // None. |
41 // Return value: | 41 // Return value: |
42 // A handle to a document. If failed, NULL is returned. | 42 // A handle to a document. If failed, NULL is returned. |
43 // | |
44 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument(); | 43 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument(); |
45 | 44 |
46 ////////////////////////////////////////////////////////////////////// | 45 ////////////////////////////////////////////////////////////////////// |
47 // | 46 // |
48 // Page functions | 47 // Page functions |
49 // | 48 // |
50 ////////////////////////////////////////////////////////////////////// | 49 ////////////////////////////////////////////////////////////////////// |
51 | 50 |
52 // Function: FPDFPage_New | 51 // Function: FPDFPage_New |
53 // Construct an empty page. | 52 // Construct an empty page. |
54 // Parameters: | 53 // Parameters: |
55 // document - Handle to document. Returned by FPDF_LoadDocument | 54 // document - Handle to document. Returned by FPDF_LoadDocument |
56 // and FPDF_CreateNewDocument. | 55 // and FPDF_CreateNewDocument. |
57 // page_index - The index of a page. | 56 // page_index - The index of a page. |
58 // width - The page width. | 57 // width - The page width. |
59 // height - The page height. | 58 // height - The page height. |
60 // Return value: | 59 // Return value: |
61 // The handle to the page. | 60 // The handle to the page. |
62 // Comments: | 61 // Comments: |
63 // Loaded page can be deleted by FPDFPage_Delete. | 62 // Loaded page can be deleted by FPDFPage_Delete. |
64 // Notes: | |
65 // The method can not support to create a new page for the document | |
66 // consists of dynamic XFA fields. | |
67 // | |
68 DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, | 63 DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, |
69 int page_index, | 64 int page_index, |
70 double width, | 65 double width, |
71 double height); | 66 double height); |
72 | 67 |
73 // Function: FPDFPage_Delete | 68 // Function: FPDFPage_Delete |
74 // Delete a PDF page. | 69 // Delete a PDF page. |
75 // Parameters: | 70 // Parameters: |
76 // document - Handle to document. Returned by FPDF_LoadDocument | 71 // document - Handle to document. Returned by FPDF_LoadDocument |
77 // and FPDF_CreateNewDocument. | 72 // and FPDF_CreateNewDocument. |
78 // page_index - The index of a page. | 73 // page_index - The index of a page. |
79 // Return value: | 74 // Return value: |
80 // None. | 75 // None. |
81 // Notes: | |
82 // The method can not support to delete page for the document consists | |
83 // of dynamic XFA fields. | |
84 // | |
85 DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index); | 76 DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index); |
86 | 77 |
87 // Function: FPDFPage_GetRotation | 78 // Function: FPDFPage_GetRotation |
88 // Get the page rotation. One of following values will be returned: | 79 // Get the page rotation. One of following values will be returned: |
89 // 0(0), 1(90), 2(180), 3(270). | 80 // 0(0), 1(90), 2(180), 3(270). |
90 // Parameters: | 81 // Parameters: |
91 // page - Handle to a page. Returned by FPDFPage_New or | 82 // page - Handle to a page. Returned by FPDFPage_New or |
92 // FPDF_LoadPage. | 83 // FPDF_LoadPage. |
93 // Return value: | 84 // Return value: |
94 // The PDF page rotation. | 85 // The PDF page rotation. |
95 // Comment: | 86 // Comment: |
96 // The PDF page rotation is rotated clockwise. | 87 // The PDF page rotation is rotated clockwise. |
97 // Notes: | |
98 // The method can not support to get the page rotate for the document | |
99 // consists of dynamic XFA fields. | |
100 // | |
101 DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page); | 88 DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page); |
102 | 89 |
103 // Function: FPDFPage_SetRotation | 90 // Function: FPDFPage_SetRotation |
104 // Set page rotation. One of following values will be set: 0(0), 1(90), | 91 // Set page rotation. One of following values will be set: 0(0), 1(90), |
105 // 2(180), 3(270). | 92 // 2(180), 3(270). |
106 // Parameters: | 93 // Parameters: |
107 // page - Handle to a page. Returned by FPDFPage_New or | 94 // page - Handle to a page. Returned by FPDFPage_New or |
108 // FPDF_LoadPage. | 95 // FPDF_LoadPage. |
109 // rotate - The value of the PDF page rotation. | 96 // rotate - The value of the PDF page rotation. |
110 // Return value: | 97 // Return value: |
111 // None. | 98 // None. |
112 // Comment: | 99 // Comment: |
113 // The PDF page rotation is rotated clockwise. | 100 // The PDF page rotation is rotated clockwise. |
114 // Notes: | |
115 // The method can not support to set this feature for the document | |
116 // consists of dynamic XFA fields. | |
117 // | 101 // |
118 DLLEXPORT void STDCALL FPDFPage_SetRotation(FPDF_PAGE page, int rotate); | 102 DLLEXPORT void STDCALL FPDFPage_SetRotation(FPDF_PAGE page, int rotate); |
119 | 103 |
120 // Function: FPDFPage_InsertObject | 104 // Function: FPDFPage_InsertObject |
121 // Insert an object to the page. The page object is automatically | 105 // Insert an object to the page. The page object is automatically |
122 // freed. | 106 // freed. |
123 // Parameters: | 107 // Parameters: |
124 // page - Handle to a page. Returned by FPDFPage_New or | 108 // page - Handle to a page. Returned by FPDFPage_New or |
125 // FPDF_LoadPage. | 109 // FPDF_LoadPage. |
126 // page_obj - Handle to a page object. Returned by | 110 // page_obj - Handle to a page object. Returned by |
127 // FPDFPageObj_NewTextObj,FPDFPageObj_NewTextObjEx and | 111 // FPDFPageObj_NewTextObj,FPDFPageObj_NewTextObjEx and |
128 // FPDFPageObj_NewPathObj. | 112 // FPDFPageObj_NewPathObj. |
129 // Return value: | 113 // Return value: |
130 // None. | 114 // None. |
131 // Notes: | |
132 // The method can not support this feature for the document consists of | |
133 // dynamic XFA fields. | |
134 // | |
135 DLLEXPORT void STDCALL FPDFPage_InsertObject(FPDF_PAGE page, | 115 DLLEXPORT void STDCALL FPDFPage_InsertObject(FPDF_PAGE page, |
136 FPDF_PAGEOBJECT page_obj); | 116 FPDF_PAGEOBJECT page_obj); |
137 | 117 |
138 // Function: FPDFPage_CountObject | 118 // Function: FPDFPage_CountObject |
139 // Get number of page objects inside the page. | 119 // Get number of page objects inside the page. |
140 // Parameters: | 120 // Parameters: |
141 // page - Handle to a page. Returned by FPDFPage_New or | 121 // page - Handle to a page. Returned by FPDFPage_New or |
142 // FPDF_LoadPage. | 122 // FPDF_LoadPage. |
143 // Return value: | 123 // Return value: |
144 // The number of the page object. | 124 // The number of the page object. |
145 // Notes: | |
146 // The method can not support this feature for the document consists of | |
147 // dynamic XFA fields. | |
148 // | |
149 DLLEXPORT int STDCALL FPDFPage_CountObject(FPDF_PAGE page); | 125 DLLEXPORT int STDCALL FPDFPage_CountObject(FPDF_PAGE page); |
150 | 126 |
151 // Function: FPDFPage_GetObject | 127 // Function: FPDFPage_GetObject |
152 // Get page object by index. | 128 // Get page object by index. |
153 // Parameters: | 129 // Parameters: |
154 // page - Handle to a page. Returned by FPDFPage_New or | 130 // page - Handle to a page. Returned by FPDFPage_New or |
155 // FPDF_LoadPage. | 131 // FPDF_LoadPage. |
156 // index - The index of a page object. | 132 // index - The index of a page object. |
157 // Return value: | 133 // Return value: |
158 // The handle of the page object. Null for failed. | 134 // The handle of the page object. Null for failed. |
159 // Notes: | |
160 // The method can not support this feature for the document consists of | |
161 // dynamic XFA fields. | |
162 // | |
163 DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPage_GetObject(FPDF_PAGE page, int index); | 135 DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPage_GetObject(FPDF_PAGE page, int index); |
164 | 136 |
165 // Function: FPDFPage_HasTransparency | 137 // Function: FPDFPage_HasTransparency |
166 // Check that whether the content of specified PDF page contains | 138 // Check that whether the content of specified PDF page contains |
167 // transparency. | 139 // transparency. |
168 // Parameters: | 140 // Parameters: |
169 // page - Handle to a page. Returned by FPDFPage_New or | 141 // page - Handle to a page. Returned by FPDFPage_New or |
170 // FPDF_LoadPage. | 142 // FPDF_LoadPage. |
171 // Return value: | 143 // Return value: |
172 // TRUE means that the PDF page does contains transparency. | 144 // TRUE means that the PDF page does contains transparency. |
173 // Otherwise, returns FALSE. | 145 // Otherwise, returns FALSE. |
174 // Notes: | |
175 // The method can not support this feature for the document consists of | |
176 // dynamic XFA fields. | |
177 // | |
178 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page); | 146 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page); |
179 | 147 |
180 // Function: FPDFPage_GenerateContent | 148 // Function: FPDFPage_GenerateContent |
181 // Generate PDF Page content. | 149 // Generate PDF Page content. |
182 // Parameters: | 150 // Parameters: |
183 // page - Handle to a page. Returned by FPDFPage_New or | 151 // page - Handle to a page. Returned by FPDFPage_New or |
184 // FPDF_LoadPage. | 152 // FPDF_LoadPage. |
185 // Return value: | 153 // Return value: |
186 // True if successful, false otherwise. | 154 // True if successful, false otherwise. |
187 // Comment: | 155 // Comment: |
188 // Before you save the page to a file, or reload the page, you must | 156 // Before you save the page to a file, or reload the page, you must |
189 // call the FPDFPage_GenerateContent function. | 157 // call the FPDFPage_GenerateContent function. |
190 // Or the changed information will be lost. | 158 // Or the changed information will be lost. |
191 // Notes: | |
192 // The method can not support this feature for the document consists of | |
193 // dynamic XFA fields. | |
194 // | |
195 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page); | 159 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page); |
196 | 160 |
197 ////////////////////////////////////////////////////////////////////// | 161 ////////////////////////////////////////////////////////////////////// |
198 // | 162 // |
199 // Page Object functions | 163 // Page Object functions |
200 // | 164 // |
201 ////////////////////////////////////////////////////////////////////// | 165 ////////////////////////////////////////////////////////////////////// |
202 | 166 |
203 // Function: FPDFPageObj_HasTransparency | 167 // Function: FPDFPageObj_HasTransparency |
204 // Check that whether the specified PDF page object contains | 168 // Check that whether the specified PDF page object contains |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // Parameters: | 201 // Parameters: |
238 // page - Handle to a page. | 202 // page - Handle to a page. |
239 // a - The coefficient "a" of the matrix. | 203 // a - The coefficient "a" of the matrix. |
240 // b - The coefficient "b" of the matrix. | 204 // b - The coefficient "b" of the matrix. |
241 // c - The coefficient "c" of the matrix. | 205 // c - The coefficient "c" of the matrix. |
242 // d - The coefficient "d" of the matrix. | 206 // d - The coefficient "d" of the matrix. |
243 // e - The coefficient "e" of the matrix. | 207 // e - The coefficient "e" of the matrix. |
244 // f - The coefficient "f" of the matrix. | 208 // f - The coefficient "f" of the matrix. |
245 // Return value: | 209 // Return value: |
246 // None. | 210 // None. |
247 // Notes: | |
248 // The method can not support this feature for the document consists of | |
249 // dynamic XFA fields. | |
250 DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page, | 211 DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page, |
251 double a, | 212 double a, |
252 double b, | 213 double b, |
253 double c, | 214 double c, |
254 double d, | 215 double d, |
255 double e, | 216 double e, |
256 double f); | 217 double f); |
257 | 218 |
258 // The page object constants. | 219 // The page object constants. |
259 #define FPDF_PAGEOBJ_TEXT 1 | 220 #define FPDF_PAGEOBJ_TEXT 1 |
(...skipping 29 matching lines...) Expand all Loading... |
289 // FPDFPageObj_NewImgeObj. | 250 // FPDFPageObj_NewImgeObj. |
290 // fileAccess - The custom file access handler, which specifies | 251 // fileAccess - The custom file access handler, which specifies |
291 // the JPEG image file. | 252 // the JPEG image file. |
292 // Return Value: | 253 // Return Value: |
293 // TRUE if successful, FALSE otherwise. | 254 // TRUE if successful, FALSE otherwise. |
294 // Note: | 255 // Note: |
295 // The image object might already has an associated image, which is | 256 // The image object might already has an associated image, which is |
296 // shared and cached by the loaded pages, In this case, we need to | 257 // shared and cached by the loaded pages, In this case, we need to |
297 // clear the cache of image for all the loaded pages. | 258 // clear the cache of image for all the loaded pages. |
298 // Pass pages and count to this API to clear the image cache. | 259 // Pass pages and count to this API to clear the image cache. |
299 // The method can not support this feature for the document consists of | |
300 // dynamic XFA fields. | |
301 // | |
302 DLLEXPORT FPDF_BOOL STDCALL | 260 DLLEXPORT FPDF_BOOL STDCALL |
303 FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, | 261 FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, |
304 int nCount, | 262 int nCount, |
305 FPDF_PAGEOBJECT image_object, | 263 FPDF_PAGEOBJECT image_object, |
306 FPDF_FILEACCESS* fileAccess); | 264 FPDF_FILEACCESS* fileAccess); |
307 | 265 |
308 // Function: FPDFImageObj_SetMatrix | 266 // Function: FPDFImageObj_SetMatrix |
309 // Set the matrix of an image object. | 267 // Set the matrix of an image object. |
310 // Parameters: | 268 // Parameters: |
311 // image_object - Handle of image object returned by | 269 // image_object - Handle of image object returned by |
(...skipping 18 matching lines...) Expand all Loading... |
330 // Set the bitmap to an image object. | 288 // Set the bitmap to an image object. |
331 // Parameters: | 289 // Parameters: |
332 // pages - Pointer's to the start of all loaded pages. | 290 // pages - Pointer's to the start of all loaded pages. |
333 // nCount - Number of pages. | 291 // nCount - Number of pages. |
334 // image_object - Handle of image object returned by | 292 // image_object - Handle of image object returned by |
335 // FPDFPageObj_NewImgeObj. | 293 // FPDFPageObj_NewImgeObj. |
336 // bitmap - The handle of the bitmap which you want to set | 294 // bitmap - The handle of the bitmap which you want to set |
337 // it to the image object. | 295 // it to the image object. |
338 // Return value: | 296 // Return value: |
339 // TRUE if successful, FALSE otherwise. | 297 // TRUE if successful, FALSE otherwise. |
340 // Notes; | |
341 // The method can not support this feature for the document consists of | |
342 // dynamic XFA fields. | |
343 // | |
344 DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages, | 298 DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages, |
345 int nCount, | 299 int nCount, |
346 FPDF_PAGEOBJECT image_object, | 300 FPDF_PAGEOBJECT image_object, |
347 FPDF_BITMAP bitmap); | 301 FPDF_BITMAP bitmap); |
348 | 302 |
349 #ifdef __cplusplus | 303 #ifdef __cplusplus |
350 } | 304 } |
351 #endif | 305 #endif |
352 | 306 |
353 #endif // PUBLIC_FPDF_EDIT_H_ | 307 #endif // PUBLIC_FPDF_EDIT_H_ |
OLD | NEW |