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