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