ipdf_page.h
页面对象:页面上元素的访问与页面属性。
介面說明保留標頭檔裡的英文原文 —— 照文件寫程式時要能一眼對上程式碼裡的註解。
class IPDF_Page
PDF page Interface.
方法(39)
| 簽章 | 說明 |
|---|---|
| Release() | Release a page object |
| GetHandler() | Get the page handler. |
| ParseContent() | Parse all page contents |
| IsParsed() | Check whether all contents has been parsed. |
| GetWidth() | Get the page width in user space. |
| GetHeight() | Get the page height in user space. |
| GetMediaBox(PDSDK_FloatRect* box) | Get page media box. |
| SetMediaBox(const PDSDK_FloatRect* box) | Set page media box. |
| GetCropBox(PDSDK_FloatRect* box) | Get page crop box. |
| SetCropBox(const PDSDK_FloatRect* box) | Set page crop box. |
| Crop(float left, float bottom, float width, float height) | Crop PDF page. |
| Rotate(int rotate) | Rotate PDF page. |
| GetRotate() | Get rotate degree. |
| GetDisplayMatrix(IPDF_Matrix* out_matrix, int x, int y, int size_x, int size_…) | Build a matrix from PDF user space to targeted device space. |
| GenerateContent() | Build the content stream. |
| BackgroundAlphaNeeded() | Whether the alpha is need when paint background. |
| GetUnit() | Get the unit of user space. |
| GetPageBBox() | Get page bounding box in user space. |
| CountPageObjects() | Get number of page objects in this page. |
| GetPageObject(int index) | Get specificed page object by index. |
| GetPageObject(const PDSDK_FloatPoint* point) | Get the top layer page object by spcificed position. |
| GetZOrder(IPDF_PageObject* pPageObj) | Get the z-order of page objects in page. |
| AddPageObject(int z_order, IPDF_PageObject* pPageObj) | Add a new page object to page. |
| AddText(const wchar_t* text, float xPos, float yPos, IPDF_Font* font…) | Add a text to page. |
| AddImage(const wchar_t* jpg_file, float left, float bottom, float siz…) | Add a jpeg picture to page. |
| AddImage(const char* jpg_file_utf8, float left, float bottom, float s…) | Add a jpeg picture to page. |
| ReplaceImage(IPDF_PageObject* pImgObj, const wchar_t* jpg_file) | Replace image. |
| AddPath(float line_width, unsigned int stroke_color, unsigned int fi…) | Add grpahic. |
| DeletePageObject(IPDF_PageObject* object) | Delete page object. |
| SendObjToBack(IPDF_PageObject* obj) | Send page object to background. |
| BringObjToFront(IPDF_PageObject* obj) | Bring page object to front. |
| MovePageObject(IPDF_PageObject* pPageObj, int move_to) | Move page object to specificed z-order. |
| LoadAnnotList() | Load the annotaionn list. |
| GetPageText() | Load the text page. |
| ExistTrailmark() | — |
| PonitInTrailmark(float x, float y) | — |
| LockPage() | Lock page |
| UnlockPage() | Unlock page |
| GetPlaceSignature(float x, float y) | Get the placed signature at the point (x, y). |
GetHandler
PDF_PageHandler GetHandler() = 0;
Get the page handler.
傳回值:The page handler.
IsParsed
int IsParsed() = 0;
Check whether all contents has been parsed.
傳回值:0 for not parsed, 1 for parsed.
GetMediaBox
void GetMediaBox(PDSDK_FloatRect* box) = 0;
Get page media box.
參數
box(out) — Received the media box data.
SetMediaBox
void SetMediaBox(const PDSDK_FloatRect* box) = 0;
Set page media box.
參數
box(in) — The new media box.
GetCropBox
void GetCropBox(PDSDK_FloatRect* box) = 0;
Get page crop box.
參數
box(out) — Received the crop box data.
SetCropBox
void SetCropBox(const PDSDK_FloatRect* box) = 0;
Set page crop box.
參數
box(in) — The new crop box data.
Crop
void Crop(float left, float bottom, float width, float height) = 0;
Crop PDF page.
參數
left(in) — The left component of crop box.bottom(in) — The bottom component of crop box.width(in) — The width of crop box.height(in) — The height of crop box.
Rotate
void Rotate(int rotate) = 0;
Rotate PDF page.
參數
rotate(in) — The rotation factor:<br>. 0: No rotation. 1: 90 degree. 2: 180 degree. 3: 270 degree.
GetRotate
int GetRotate() = 0;
Get rotate degree.
傳回值:0, 1, 2, 3.
GetDisplayMatrix
void GetDisplayMatrix(IPDF_Matrix* out_matrix, int x, int y, int size_x, int size_y, int rotate) = 0;
Build a matrix from PDF user space to targeted device space.
參數
out_matrix(out) — Receives the transform matrix.x(in) — The x-coordinate in the device space.y(in) — The y-coordinate in the device space.size_x(in) — The x-direction size in the device space.size_y(in) — The y-direction size in the device space.rotate(in) — The rotation degrees.
BackgroundAlphaNeeded
int BackgroundAlphaNeeded() = 0;
Whether the alpha is need when paint background.
傳回值:0 for not need alpha, 2 for need alpha.
GetUnit
float GetUnit() = 0;
Get the unit of user space.
傳回值:A positive number giving the size of default user space units, in multiples of 1⁄72 inch.
CountPageObjects
int CountPageObjects() = 0;
Get number of page objects in this page.
傳回值:The number of page objects.
GetPageObject
IPDF_PageObject* GetPageObject(int index) = 0;
Get specificed page object by index.
參數
index(in) — The zero-based index, must less than CountPageObjects().
傳回值:The page object specificed by index.
GetPageObject
IPDF_PageObject* GetPageObject(const PDSDK_FloatPoint* point) = 0;
Get the top layer page object by spcificed position.
參數
point(in) — The (x, y) point in PDF user space.
傳回值:The page object specificed by position.
GetZOrder
int GetZOrder(IPDF_PageObject* pPageObj) = 0;
Get the z-order of page objects in page.
參數
pPageObj(in) — The page object.
傳回值:A positive number giving the z-order.
AddPageObject
void AddPageObject(int z_order, IPDF_PageObject* pPageObj) = 0;
Add a new page object to page.
參數
z_order(in) — The z_order.pPageObj(in) — The new page object.
AddText
IPDF_PageObject* AddText(const wchar_t* text, float xPos, float yPos, IPDF_Font* font, float font_size, unsigned int color) = 0;
Add a text to page.
參數
text(in) — The text(unicode encodding).xPos(in) — The x component of text baseline.yPos(in) — The y component of text baseline.font(in) — The font for text.size(in) — The font size for text.
傳回值:The page object specificed by position.
AddImage
IPDF_PageObject* AddImage(const wchar_t* jpg_file, float left, float bottom, float size_x, float size_y, float alpha, PDSDK_PathData* pClipPath = 0) = 0;
Add a jpeg picture to page.
參數
jpg_file(in) — The jpeg file path(unicode encodding).left(in) — The x component of left-bottom corner.bottom(in) — The y component of left-bottom corner.size_x(in) — The x-direction size.size_y(in) — The y-direction size.alpah(in) — The opacity form 0 to 1.0.
傳回值:The page object specificed by position.
AddImage
IPDF_PageObject* AddImage(const char* jpg_file_utf8, float left, float bottom, float size_x, float size_y, float alpha, PDSDK_PathData* pClipPath = 0) = 0;
Add a jpeg picture to page.
參數
jpg_file(in) — The jpeg file path(utf8 encodding).left(in) — The x component of left-bottom corner.bottom(in) — The y component of left-bottom corner.size_x(in) — The x-direction size.size_y(in) — The y-direction size.alpah(in) — The opacity form 0 to 1.0.
傳回值:The page object specificed by position.
ReplaceImage
IPDF_PageObject* ReplaceImage(IPDF_PageObject* pImgObj, const wchar_t* jpg_file) = 0;
Replace image.
參數
pImgObj(in) — The image object to be replaced.jpg_file(in) — The jpeg file used to repalce the image ogf pImgObj. return A new image object.
AddPath
IPDF_PageObject* AddPath(float line_width, unsigned int stroke_color, unsigned int fill_color, float* points, int* point_flag, int point_count) = 0;
Add grpahic.
參數
line_width(in) — Line width.stroke_color(in) — Stroke color.fill_color(in) — Fill color.points(in) — The(x,y) pair points array.point_flag(in) — Flag of (x,y)pair point.point_count(in) — Point count. return A new page object.
MovePageObject
void MovePageObject(IPDF_PageObject* pPageObj, int move_to) = 0;
Move page object to specificed z-order.
參數
pPageObj(in) — Page object to be moved.move_to(in) — The destinat z-order.