ArkoPDF
← SDK API リファレンス

ipdf_base.h

Basic data structure definitions, such as matrix, bitmap and font.

インターフェースの説明はヘッダーの英語原文のままにしています。読んでいるコードと突き合わせやすくするためです。

定数

シグネチャValueDescription
DIB_RGB024bpp RGB bitmap. Byte order: BGR.
DIB_RGBA1@brief24bpp RGB bitmap with extra alpha channel. Byte order: BGR + 8bppMask.
DIB_ARGB232bpp ARGB bitmap. Byte order: BGRA.
DIB_RGB32332bpp RGB bitmap. Byte order: BGR, 4th byte not used.
PDSDKEXPORT__declspec(dllexport)—
PDF_ZOOM_XYZ1[left, top, zoom]. Spcificed the coordinates (left, top) as the upper-left corner of the window and zoom factor whitch used to magnify the contents of the page.
PDF_ZOOM_FITPAGE2Magnify contents just enough to fit the entire page within the view window both horizontally and vertically.
PDF_ZOOM_FITHORZ3[top]. With the vertical coordinate top positioned at the top edge of the window and magnify contents of the page just enough to fit the entire width of the page within the window.
PDF_ZOOM_FITVERT4[left]. With the horizontal coordinate left positioned at the left edge of the window and magnify contents of the page just enough to fit the entire height of the page within the view window.
PDF_ZOOM_FITRECT5[left, bottom, right, top]. Magnify contents of the page just enough to fit the rectangle specified by the coordinates left, bottom, right, and top entirely within the view window both horizontally and vertically.
PDF_ZOOM_FITBBOX6Mangify the contents of the page just enough to fit its bounding box entirely within the view window both horizontally and vertically.
PDF_ZOOM_FITBHORZ7With the vertical coordinate top positioned at the top edge of the window and magnify contents of the page just enough to fit the entire width of its bounding box within the window
PDF_ZOOM_FITBVERT8With the horizontal coordinate left positioned at the left edge of the window and magnify contents of the page just enough to fit the entire height of its bounding box within the view window.
COLOR_MAKERGB(r, g, b) ((r) | ((g) << 8) | ((b) << 16))The RGB macro selects a red, green, blue color based on the arguments supplied.
COLOR_GetRValue(rgb) ((rgb) & 0xff)Get the red component.
COLOR_GetGValue(rgb) (((rgb) >> 8) & 0xff)Get the green component.
COLOR_GetBValue(rgb) (((rgb) >> 16) & 0xff)Get the blue component.
COLOR_ARGB_MAKE(a,r,g,b) (((unsigned int)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))Create a ARGB from the alpha, red, green, and blue components.
COLOR_ARGB_A(argb) ((unsigned char)((argb) >> 24))Get the alpha component.
COLOR_ARGB_R(argb) ((unsigned char)((argb) >> 16))Get the red component.
COLOR_ARGB_G(argb) ((unsigned char)((argb) >> 8))Get the green component.
COLOR_ARGB_B(argb) ((unsigned char)(argb))Get the blue component.
DIB_BLEND_NORMAL0Selects the source color, ignoring the backdrop.
DIB_BLEND_MULTIPLY1Multiplies the backdrop and source color values.
DIB_BLEND_SCREEN2Multiplies the complements of the backdrop and source color values, then complements the result.
DIB_BLEND_OVERLAY3Multiplies or screens the colors, depending on the backdrop color value.
DIB_BLEND_DARKEN4Selects the darker of the backdrop and source colors.
DIB_BLEND_LIGHTEN5Selects the lighter of the backdrop and source colors.
DIB_BLEND_COLORDODGE6Brightens the backdrop color to reflect the source color.
DIB_BLEND_COLORBURN7Darkens the backdrop color to reflect the source color.
DIB_BLEND_UNSUPPORTED-1Unsupport type.
PDSDK_FONT_FIXED_PITCH0x01—
PDSDK_FONT_SERIF0x02—
PDSDK_FONT_SYMBOLIC0x04—
PDSDK_FONT_SCRIPT0x08—
PDSDK_FONT_ITALIC0x40—
PDSDK_FONT_BOLD0x40000—
PDSDK_FONT_CIDFONT_CHARSET0x100000—
PDSDK_FONT_ANSI_CHARSET0—
PDSDK_FONT_DEFAULT_CHARSET1—
PDSDK_FONT_SYMBOL_CHARSET2—
PDSDK_FONT_SHIFTJIS_CHARSET128Jpanese
PDSDK_FONT_HANGEUL_CHARSET129Korean
PDSDK_FONT_GB2312_CHARSET134Chinese simple
PDSDK_FONT_CHINESEBIG5_CHARSET136Chinese trade
PDSDK_FONT_THAI_CHARSET222Tailand
PDSDK_FONT_EASTEUROPE_CHARSET238East Uropean
PDSDK_FONT_RUSSIAN_CHARSET204Russian
PDSDK_FONT_GREEK_CHARSET161Greek
PDSDK_FONT_TURKISH_CHARSET162Tukish
PDSDK_FONT_VIETNAMESE_CHARSET163Vietnamese
PDSDK_FONT_HEBREW_CHARSET177Heberew
PDSDK_FONT_ARABIC_CHARSET178Arabic
PDSDK_FONT_BALTIC_CHARSET186Baltic
PDSDK_FONT_FF_FIXEDPITCH1—
PDSDK_FONT_FF_ROMAN(1<<4)—
PDSDK_FONT_FF_SCRIPT(4<<4)—
PDSDK_FONT_FW_NORMAL400—
PDSDK_FONT_FW_BOLD700—
PDSDK_FONT_TYPE11Type1.
PDSDK_FONT_TRUETYPE2Truetype.
PDSDK_FONT_TYPE33Type3.
PDSDK_FONT_CIDFONT4CID font.
PDSDK_CIDSET_UNKNOWN0Unknown.
PDSDK_CIDSET_GB11Adobe-GB1.
PDSDK_CIDSET_CNS12Adobe-CNS1.
PDSDK_CIDSET_JAPAN13Adobe-Japan1.
PDSDK_CIDSET_KOREA14Adobe-Korea1.
PDSDK_CIDSET_UNICODE5Unicode.
PDSDK_FONT_FIXEDPITCH1All glyphs have the same width.
PDSDK_FONT_SERIF2Glyphs have serifs
PDSDK_FONT_SYMBOLIC4Glyphs outside the Adobe standard Latin character set.
PDSDK_FONT_SCRIPT8Glyphs resemble cursive handwriting.
PDSDK_FONT_NONSYMBOLIC32Adobe standard Latin character set or a subset of it.
PDSDK_FONT_ITALIC64Glyphs have dominant vertical strokes that are slanted.
PDSDK_FONT_ALLCAP0x10000No lowercase letters.
PDSDK_FONT_SMALLCAP0x20000Both uppercase and lowercase letters.
PDSDK_FONT_FORCEBOLD0x40000Force bold even at very small text sizes.
PDSDK_FONT_USEEXTERNATTR0x80000Additional font flag
NEEDTOPAUSE_NO0—
NEEDTOPAUSE_YES1—
PDSDK_PT_LINETO0x02—
PDSDK_PT_BEZIERTO0x04—
PDSDK_PT_MOVETO0x06—
PDSDK_PT_TYPE0x06—
PDSDK_FILL_ALTERNATE1—
PDSDK_FILL_WINDING2—
PDF_CARET_LEFT-1The previous caret.
PDF_CARET_RIGHT1The next caret.
PDF_CARET_UP-2The upon caret.
PDF_CARET_DOWN2The down caret.

class IPDF_Matrix

The interface of affine transformation matrix. A matrix defines six coefficients: a, b, c, d, e, f. The transformation equations are: dest_x = a * src_x + c * src_y + e; dest_y = b * src_x + d * src_y + f;

メソッド(21)

シグネチャ説明
Release()Release a matrix.
Set(float a, float b, float c, float d, float e, float f)Set the six input coefficients .
GetA()Get a coefficient.
GetB()Get b coefficient.
GetC()Get e coefficient.
GetD()Get d coefficient.
GetE()Get e coefficient.
GetF()Get f coefficient.
Scale(float sx, float sy, int bPrepended = 0)Scale the matrix.
Rotate(float radian, int bPrepended)Rotate the matrix.
RotateAt(float radian, float dx, float dy, int bPrepended)Rotate the matrix at a specificed position.
TransformPoint(PDSDK_FloatPoint* point)Transform a point.
TransformPoint(PDSDK_Point* point)Transform a point.
TransformRect(PDSDK_FloatRect* rect)Transform a rectangle.
TransformRect(PDSDK_Rect* rect)Transform a rectangle.
TransformBox(PDSDK_FloatBox* box)Transform a quadrilateral.
MatchRect(const PDSDK_FloatRect* dest_rect, const PDSDK_FloatRect* src…)Get a matrix that transforms a source rectangle to dest rectangle.
Concat(const IPDF_Matrix* matrix, int bPrepended = 0)Concatenate with another matrix.
ConcatInverse(const IPDF_Matrix* matrix, int bPrepended = 0)Concatenate the inverse of another matrix.
SetReverse(const IPDF_Matrix* src_matrix)Set the coefficients of the inverse of another matrix to this matrix.
Translate(float x, float y, int bPrepended = 0)Translate the matrix.
Set
void Set(float a, float b, float c, float d, float e, float f) = 0;

Set the six input coefficients .

パラメータ

  • a(in) — The input coefficient a.
  • b(in) — The input coefficient b.
  • c(in) — The input coefficient c.
  • d(in) — The input coefficient d.
  • e(in) — The input coefficient e.
  • f(in) — The input coefficient f.
Scale
void Scale(float sx, float sy, int bPrepended = 0) = 0;

Scale the matrix.

パラメータ

  • sx(in) — The x-direction scale coefficient.
  • sy(in) — The y-direction scale coefficient.
  • bPrepended(in) — If it's none-zero, a scaling matrix is concat at left side, otherwise concat at right side.
Rotate
void Rotate(float radian, int bPrepended) = 0;

Rotate the matrix.

パラメータ

  • radian(in) — Rotation angle in radian.
  • bPrepended(in) — If it's none-zero, a scaling matrix is concat at left side, otherwise concat at right side.
RotateAt
void RotateAt(float radian, float dx, float dy, int bPrepended) = 0;

Rotate the matrix at a specificed position.

パラメータ

  • radian(in) — Rotation angle in radian.
  • x(in) — The x coordinate of rotation point.
  • y(in) — The y coordinate of rotation point.
  • bPrepended(in) — If it's none-zero, a scaling matrix is concat at left side, otherwise concat at right side.
TransformPoint
void TransformPoint(PDSDK_FloatPoint* point) = 0;

Transform a point.

パラメータ

  • point(in,out) — The input point, and It receives the output transformed point.
TransformPoint
void TransformPoint(PDSDK_Point* point) = 0;

Transform a point.

パラメータ

  • point(in,out) — The input point, and It receives the output transformed point.
TransformRect
void TransformRect(PDSDK_FloatRect* rect) = 0;

Transform a rectangle.

パラメータ

  • rect(in,out) — The input rectangle, and it receives the output transformed and normalized rectangle.
TransformRect
void TransformRect(PDSDK_Rect* rect) = 0;

Transform a rectangle.

パラメータ

  • rect(in,out) — The input rectangle, and it receives the output transformed and normalized rectangle.
TransformBox
void TransformBox(PDSDK_FloatBox* box) = 0;

Transform a quadrilateral.

パラメータ

  • box(in,out) — The input quadrilateral, and it receives the output transformed and normalized quadrilateral.
MatchRect
void MatchRect(const PDSDK_FloatRect* dest_rect, const PDSDK_FloatRect* src_rect) = 0;

Get a matrix that transforms a source rectangle to dest rectangle.

パラメータ

  • dest_rect(in) — The dest rectangle.
  • src_rect(in) — The source rectangle.
Concat
void Concat(const IPDF_Matrix* matrix, int bPrepended = 0) = 0;

Concatenate with another matrix.

パラメータ

  • matrix(in) — The input matrix.
  • bPrepended(in) — If it's none-zero, a scaling matrix is concat at left side, otherwise concat at right side.
ConcatInverse
void ConcatInverse(const IPDF_Matrix* matrix, int bPrepended = 0) = 0;

Concatenate the inverse of another matrix.

パラメータ

  • matrix(in) — The input matrix.
  • bPrepended(in) — If it's none-zero, a scaling matrix is concat at left side, otherwise concat at right side.
SetReverse
void SetReverse(const IPDF_Matrix* src_matrix) = 0;

Set the coefficients of the inverse of another matrix to this matrix.

パラメータ

  • m(in) — The input matrix.
Translate
void Translate(float x, float y, int bPrepended = 0) = 0;

Translate the matrix.

パラメータ

  • x(in) — The x-direction delta value.
  • y(in) — The y-direction delta value.
  • bPrepended(in) — If it's none-zero, a scaling matrix is concat at left side, otherwise concat at right side.

class IPDF_DIBitmap

Device Independent Bitmap Interface.

メソッド(12)

シグネチャ説明
Release()Release a bitmap.
Clone()Clone a bitmap.
Clear(unsigned int clr)Fill bitmap with specified color.
GetWidth()Get the width of the bitmap.
GetHeight()Get the height of the bitmap.
GetBpp()Get the number of BITS per pixel.
GetPitch()Get the row pitch of the bitmap.
GetPixels()Get a pixels buffer.
CompositeBitmap(int dest_left, int dest_top, int width, int height, const IP…)Composite and blend source bitmap into this bitmap.
StretchTo(int dest_width, int dest_height)Stretch this bitmap into a new bitmap with different size.
SetPixel(int x, int y, unsigned int color)Set pixel color.
CopyBuffer(unsigned char* pOtherBuf, unsigned int len)Copy pixel data.
Clone
IPDF_DIBitmap* Clone() = 0;

Clone a bitmap.

戻り値:A cloned bitmap.

Clear
void Clear(unsigned int clr) = 0;

Fill bitmap with specified color.

パラメータ

  • clr(in) — The specified color to fill.
GetBpp
int GetBpp() = 0;

Get the number of BITS per pixel.

戻り値:The number of bits per pixel.

GetPixels
unsigned char* GetPixels() = 0;

Get a pixels buffer.

戻り値:A pixels buffer for the bitmap.

CompositeBitmap
int CompositeBitmap(int dest_left, int dest_top, int width, int height, const IPDF_DIBitmap* src_bitmap, int src_left, int src_top, int blend_type = DIB_BLEND_NORMAL) = 0;

Composite and blend source bitmap into this bitmap.

パラメータ

  • dest_left(in) — The x-coordinate in destination bitmap.
  • dest_top(in) — The y-coordinate in destination bitmap.
  • width(in) — The area width to composite.
  • height(in) — The area height to composite.
  • src_bitmap(in) — The source bitmap.
  • src_left(in) — The x-coordinate in source bitmap.
  • src_top(in) — The y-coordinate in source bitmap.
  • blend_type(in) — Blend type.
StretchTo
void StretchTo(int dest_width, int dest_height) = 0;

Stretch this bitmap into a new bitmap with different size.

パラメータ

  • dest_width(in) — The width of the destination bitmap.
  • dest_height(in) — The height of the destination bitmap.
SetPixel
void SetPixel(int x, int y, unsigned int color) = 0;

Set pixel color.

パラメータ

  • x(in) — The x-coordinate in bitmap.
  • y(in) — The y-coordinate in bitmap.
  • color(in) — The input pixel color.
CopyBuffer
void CopyBuffer(unsigned char* pOtherBuf, unsigned int len) = 0;

Copy pixel data.

パラメータ

  • pOtherBuf(in/out) — The pixel buffer to receive the pixel data.
  • len(in) — Number of bytes for pOtherBuf.

class IPDF_Font

PDF font interface.

メソッド(16)

シグネチャ説明
GetType()Get the font type.
GetFlag()Get the font flags. @see Font flags
IsEmbbedded()Check whether the font is an embedded font.
GetCharset()Get the charset.
IsItalic()Check whether the font is italic.
IsBold()Check whether the font is bold.
IsVertical()Check whether the font is vertical.
Equal(IPDF_Font* other)Check whether the font is equle as other font.
IsCharExist(wchar_t ch)Check whether the font is contain the specificed character.
GetFamilyName()Get family name.
GetFaceName()Get font face name.
GetBaseFont()Get base font name.
GetBaseFont_UTF8()Get base font name.
GetFontHeight(float font_size)Get font height.
GetCharWidthF(unsigned long charcode)Get a character's PDF width.
FindSubstFont(int charset)Find a subsitiation font.
GetType
public: virtual int GetType() = 0;

Get the font type.

戻り値:The font type.

IsEmbbedded
int IsEmbbedded() = 0;

Check whether the font is an embedded font.

戻り値:Zero for Non-embbedded, otherwise embbedded.

GetCharset
int GetCharset() = 0;

Get the charset.

戻り値:The charset.

IsItalic
int IsItalic() = 0;

Check whether the font is italic.

戻り値:Zero for normal, otherwise italic.

IsBold
int IsBold() = 0;

Check whether the font is bold.

戻り値:Zero for normal, otherwise bold.

IsVertical
int IsVertical() = 0;

Check whether the font is vertical.

戻り値:Zero for normal, otherwise it is vertical.

Equal
int Equal(IPDF_Font* other) = 0;

Check whether the font is equle as other font.

戻り値:Zero for different, otherwise it is same font.

same font means the PDF Font is a same one.

IsCharExist
int IsCharExist(wchar_t ch) = 0;

Check whether the font is contain the specificed character.

パラメータ

  • ch(in) — The unicode charcode.

戻り値:Zero means the font does not contain the character, otherwise contain.

GetCharWidthF
float GetCharWidthF(unsigned long charcode) = 0;

Get a character's PDF width.

パラメータ

  • charcode(in) — Input a character code.

戻り値:The PDF width of the character.

FindSubstFont
IPDF_Font* FindSubstFont(int charset) = 0;

Find a subsitiation font.

パラメータ

  • charset(in) — The input charset.

戻り値:The subsitiation font.

class IPDF_Pause

Simple pause interface. Must be implemented by customer.

メソッド(1)

シグネチャ説明
NeedToPause()Do we need to pause now ?
NeedToPause
public: virtual int NeedToPause() = 0;

Do we need to pause now ?

戻り値:Non-zero means we need, otherwise we need not.

class IPDF_Progress

Simple progress interface. Must be implemented by customer.

メソッド(3)

シグネチャ説明
IsCancel()Is the progress is canceled by user?
SetRange(float min, float max)Set the range of progress.
SetCurPos(float pos)Set current position of progress.
IsCancel
public: virtual int IsCancel() = 0;

Is the progress is canceled by user?

戻り値:Non-zero means cancel, otherwise not cacel.

SetRange
void SetRange(float min, float max) = 0;

Set the range of progress.

パラメータ

  • min(in) — The minimized value.
  • max(in) — The maximized value.
SetCurPos
void SetCurPos(float pos) = 0;

Set current position of progress.

パラメータ

  • pos(in) — Current position.