ArkoPDF
← SDK API reference

ipdf_page.h

页面对象:页面上元素的访问与页面属性。

Interface descriptions keep the original English from the headers, so you can match them against the code you are reading.

class IPDF_Page

PDF page Interface.

Methods(39)

SignatureDescription
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.

Returns:The page handler.

IsParsed
int IsParsed() = 0;

Check whether all contents has been parsed.

Returns:0 for not parsed, 1 for parsed.

GetMediaBox
void GetMediaBox(PDSDK_FloatRect* box) = 0;

Get page media box.

Parameters

  • box(out) — Received the media box data.
SetMediaBox
void SetMediaBox(const PDSDK_FloatRect* box) = 0;

Set page media box.

Parameters

  • box(in) — The new media box.
GetCropBox
void GetCropBox(PDSDK_FloatRect* box) = 0;

Get page crop box.

Parameters

  • box(out) — Received the crop box data.
SetCropBox
void SetCropBox(const PDSDK_FloatRect* box) = 0;

Set page crop box.

Parameters

  • box(in) — The new crop box data.
Crop
void Crop(float left, float bottom, float width, float height) = 0;

Crop PDF page.

Parameters

  • 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.

Parameters

  • 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.

Returns: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.

Parameters

  • 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.

Returns:0 for not need alpha, 2 for need alpha.

GetUnit
float GetUnit() = 0;

Get the unit of user space.

Returns: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.

Returns:The number of page objects.

GetPageObject
IPDF_PageObject* GetPageObject(int index) = 0;

Get specificed page object by index.

Parameters

  • index(in) — The zero-based index, must less than CountPageObjects().

Returns:The page object specificed by index.

GetPageObject
IPDF_PageObject* GetPageObject(const PDSDK_FloatPoint* point) = 0;

Get the top layer page object by spcificed position.

Parameters

  • point(in) — The (x, y) point in PDF user space.

Returns:The page object specificed by position.

GetZOrder
int GetZOrder(IPDF_PageObject* pPageObj) = 0;

Get the z-order of page objects in page.

Parameters

  • pPageObj(in) — The page object.

Returns:A positive number giving the z-order.

AddPageObject
void AddPageObject(int z_order, IPDF_PageObject* pPageObj) = 0;

Add a new page object to page.

Parameters

  • 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.

Parameters

  • 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.

Returns: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.

Parameters

  • 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.

Returns: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.

Parameters

  • 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.

Returns:The page object specificed by position.

ReplaceImage
IPDF_PageObject* ReplaceImage(IPDF_PageObject* pImgObj, const wchar_t* jpg_file) = 0;

Replace image.

Parameters

  • 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.

Parameters

  • 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.

Parameters

  • pPageObj(in) — Page object to be moved.
  • move_to(in) — The destinat z-order.