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