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_TRANSFORMPAGE_H_ | 7 #ifndef PUBLIC_FPDF_TRANSFORMPAGE_H_ |
8 #define PUBLIC_FPDF_TRANSFORMPAGE_H_ | 8 #define PUBLIC_FPDF_TRANSFORMPAGE_H_ |
9 | 9 |
10 #include "fpdfview.h" | 10 #include "fpdfview.h" |
11 | 11 |
12 #ifdef __cplusplus | 12 #ifdef __cplusplus |
13 extern "C" { | 13 extern "C" { |
14 #endif | 14 #endif |
15 | 15 |
16 typedef void* FPDF_PAGEARCSAVER; | 16 typedef void* FPDF_PAGEARCSAVER; |
17 typedef void* FPDF_PAGEARCLOADER; | 17 typedef void* FPDF_PAGEARCLOADER; |
18 | 18 |
19 /** | 19 /** |
20 * Set "MediaBox" entry to the page dictionary. | 20 * Set "MediaBox" entry to the page dictionary. |
21 * @param[in] page - Handle to a page. | 21 * @param[in] page - Handle to a page. |
22 * @param[in] left - The left of the rectangle. | 22 * @param[in] left - The left of the rectangle. |
23 * @param[in] bottom - The bottom of the rectangle. | 23 * @param[in] bottom - The bottom of the rectangle. |
24 * @param[in] right - The right of the rectangle. | 24 * @param[in] right - The right of the rectangle. |
25 * @param[in] top - The top of the rectangle. | 25 * @param[in] top - The top of the rectangle. |
26 * @retval None. | 26 * @retval None. |
27 */ | 27 */ |
28 DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bo
ttom, float right, float top); | 28 DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, |
| 29 float left, |
| 30 float bottom, |
| 31 float right, |
| 32 float top); |
29 | 33 |
30 /** | 34 /** |
31 * Set "CropBox" entry to the page dictionary. | 35 * Set "CropBox" entry to the page dictionary. |
32 * @param[in] page - Handle to a page. | 36 * @param[in] page - Handle to a page. |
33 * @param[in] left - The left of the rectangle. | 37 * @param[in] left - The left of the rectangle. |
34 * @param[in] bottom - The bottom of the rectangle. | 38 * @param[in] bottom - The bottom of the rectangle. |
35 * @param[in] right - The right of the rectangle. | 39 * @param[in] right - The right of the rectangle. |
36 * @param[in] top - The top of the rectangle. | 40 * @param[in] top - The top of the rectangle. |
37 * @retval None. | 41 * @retval None. |
38 */ | 42 */ |
39 DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, float left, float bot
tom, float right, float top); | 43 DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, |
40 | 44 float left, |
| 45 float bottom, |
| 46 float right, |
| 47 float top); |
41 | 48 |
42 /** Get "MediaBox" entry from the page dictionary. | 49 /** Get "MediaBox" entry from the page dictionary. |
43 * @param[in] page - Handle to a page. | 50 * @param[in] page - Handle to a page. |
44 * @param[in] left - Pointer to a double value receiving the left of the rectan
gle. | 51 * @param[in] left - Pointer to a double value receiving the left of the |
45 * @param[in] bottom - Pointer to a double value receiving the bottom of the rect
angle. | 52 * rectangle. |
46 * @param[in] right - Pointer to a double value receiving the right of the recta
ngle. | 53 * @param[in] bottom - Pointer to a double value receiving the bottom of the |
47 * @param[in] top - Pointer to a double value receiving the top of the rectang
le. | 54 * rectangle. |
| 55 * @param[in] right - Pointer to a double value receiving the right of the |
| 56 * rectangle. |
| 57 * @param[in] top - Pointer to a double value receiving the top of the |
| 58 * rectangle. |
48 * @retval True if success,else fail. | 59 * @retval True if success,else fail. |
49 */ | 60 */ |
50 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, fl
oat* bottom, float* right, float* top); | 61 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, |
| 62 float* left, |
| 63 float* bottom, |
| 64 float* right, |
| 65 float* top); |
51 | 66 |
52 /** Get "CropBox" entry from the page dictionary. | 67 /** Get "CropBox" entry from the page dictionary. |
53 * @param[in] page - Handle to a page. | 68 * @param[in] page - Handle to a page. |
54 * @param[in] left - Pointer to a double value receiving the left of the rectan
gle. | 69 * @param[in] left - Pointer to a double value receiving the left of the |
55 * @param[in] bottom - Pointer to a double value receiving the bottom of the rect
angle. | 70 * rectangle. |
56 * @param[in] right - Pointer to a double value receiving the right of the recta
ngle. | 71 * @param[in] bottom - Pointer to a double value receiving the bottom of the |
57 * @param[in] top - Pointer to a double value receiving the top of the rectang
le. | 72 * rectangle. |
| 73 * @param[in] right - Pointer to a double value receiving the right of the |
| 74 * rectangle. |
| 75 * @param[in] top - Pointer to a double value receiving the top of the |
| 76 * rectangle. |
58 * @retval True if success,else fail. | 77 * @retval True if success,else fail. |
59 */ | 78 */ |
60 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, float* left, flo
at* bottom, float* right, float* top); | 79 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, |
| 80 float* left, |
| 81 float* bottom, |
| 82 float* right, |
| 83 float* top); |
61 | 84 |
62 /** | 85 /** |
63 * Transform the whole page with a specified matrix, then clip the page content r
egion. | 86 * Transform the whole page with a specified matrix, then clip the page content |
| 87 * region. |
64 * | 88 * |
65 * @param[in] page - A page handle. | 89 * @param[in] page - A page handle. |
66 * @param[in] matrix - The transform matrix. | 90 * @param[in] matrix - The transform matrix. |
67 * @param[in] clipRect - A rectangle page area to be clipped. | 91 * @param[in] clipRect - A rectangle page area to be clipped. |
68 * @Note. This function will transform the whole page, and would take effect to a
ll the objects in the page. | 92 * @Note. This function will transform the whole page, and would take effect to |
| 93 * all the objects in the page. |
69 */ | 94 */ |
70 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX
* matrix, FS_RECTF* clipRect); | 95 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, |
| 96 FS_MATRIX* matrix, |
| 97 FS_RECTF* clipRect); |
71 | 98 |
72 /** | 99 /** |
73 * Transform (scale, rotate, shear, move) the clip path of page object. | 100 * Transform (scale, rotate, shear, move) the clip path of page object. |
74 * @param[in] page_object - Handle to a page object. Returned by FPDFPageObj_NewI
mageObj. | 101 * @param[in] page_object - Handle to a page object. Returned by |
| 102 * FPDFPageObj_NewImageObj. |
75 * @param[in] a - The coefficient "a" of the matrix. | 103 * @param[in] a - The coefficient "a" of the matrix. |
76 * @param[in] b - The coefficient "b" of the matrix. | 104 * @param[in] b - The coefficient "b" of the matrix. |
77 * @param[in] c - The coefficient "c" of the matrix. | 105 * @param[in] c - The coefficient "c" of the matrix. |
78 * @param[in] d - The coefficient "d" of the matrix. | 106 * @param[in] d - The coefficient "d" of the matrix. |
79 * @param[in] e - The coefficient "e" of the matrix. | 107 * @param[in] e - The coefficient "e" of the matrix. |
80 * @param[in] f - The coefficient "f" of the matrix. | 108 * @param[in] f - The coefficient "f" of the matrix. |
81 * @retval None. | 109 * @retval None. |
82 */ | 110 */ |
83 DLLEXPORT void STDCALL FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object
,double a, double b, double c, double d, double e, double f); | 111 DLLEXPORT void STDCALL |
| 112 FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object, |
| 113 double a, |
| 114 double b, |
| 115 double c, |
| 116 double d, |
| 117 double e, |
| 118 double f); |
84 | 119 |
85 /** | 120 /** |
86 * Create a new clip path, with a rectangle inserted. | 121 * Create a new clip path, with a rectangle inserted. |
87 * | 122 * |
88 * @param[in] left - The left of the clip box. | 123 * @param[in] left - The left of the clip box. |
89 * @param[in] bottom - The bottom of the clip box. | 124 * @param[in] bottom - The bottom of the clip box. |
90 * @param[in] right - The right of the clip box. | 125 * @param[in] right - The right of the clip box. |
91 * @param[in] top - The top of the clip box. | 126 * @param[in] top - The top of the clip box. |
92 * @retval a handle to the clip path. | 127 * @retval a handle to the clip path. |
93 */ | 128 */ |
94 DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, float bottom, fl
oat right, float top); | 129 DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, |
| 130 float bottom, |
| 131 float right, |
| 132 float top); |
95 | 133 |
96 /** | 134 /** |
97 * Destroy the clip path. | 135 * Destroy the clip path. |
98 * | 136 * |
99 * @param[in] clipPath - A handle to the clip path. | 137 * @param[in] clipPath - A handle to the clip path. |
100 * Destroy the clip path. | 138 * Destroy the clip path. |
101 * @retval None. | 139 * @retval None. |
102 */ | 140 */ |
103 DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath); | 141 DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath); |
104 | 142 |
105 /** | 143 /** |
106 * Clip the page content, the page content that outside the clipping region becom
e invisible. | 144 * Clip the page content, the page content that outside the clipping region |
| 145 * become invisible. |
107 * | 146 * |
108 * @param[in] page - A page handle. | 147 * @param[in] page - A page handle. |
109 * @param[in] clipPath - A handle to the clip path. | 148 * @param[in] clipPath - A handle to the clip path. |
110 * @Note. A clip path will be inserted before the page content stream or content
array. In this way, the page content will be clipped | 149 * @Note. A clip path will be inserted before the page content stream or content |
| 150 * array. In this way, the page content will be clipped |
111 * by this clip path. | 151 * by this clip path. |
112 */ | 152 */ |
113 DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clip
Path); | 153 DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page, |
| 154 FPDF_CLIPPATH clipPath); |
114 | 155 |
115 #ifdef __cplusplus | 156 #ifdef __cplusplus |
116 } | 157 } |
117 #endif | 158 #endif |
118 | 159 |
119 #endif // PUBLIC_FPDF_TRANSFORMPAGE_H_ | 160 #endif // PUBLIC_FPDF_TRANSFORMPAGE_H_ |
OLD | NEW |