ipdf_base.h
Basic data structure definitions, such as matrix, bitmap and font.
Las descripciones de las interfaces se mantienen en el inglés original de las cabeceras, para que puedas contrastarlas con el código.
Constantes
| Firma | Value | Description |
|---|---|---|
| DIB_RGB | 0 | 24bpp RGB bitmap. Byte order: BGR. |
| DIB_RGBA | 1 | @brief24bpp RGB bitmap with extra alpha channel. Byte order: BGR + 8bppMask. |
| DIB_ARGB | 2 | 32bpp ARGB bitmap. Byte order: BGRA. |
| DIB_RGB32 | 3 | 32bpp RGB bitmap. Byte order: BGR, 4th byte not used. |
| PDSDKEXPORT | __declspec(dllexport) | — |
| PDF_ZOOM_XYZ | 1 | [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_FITPAGE | 2 | Magnify contents just enough to fit the entire page within the view window both horizontally and vertically. |
| PDF_ZOOM_FITHORZ | 3 | [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_FITVERT | 4 | [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_FITRECT | 5 | [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_FITBBOX | 6 | Mangify the contents of the page just enough to fit its bounding box entirely within the view window both horizontally and vertically. |
| PDF_ZOOM_FITBHORZ | 7 | 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 its bounding box within the window |
| PDF_ZOOM_FITBVERT | 8 | 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 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_NORMAL | 0 | Selects the source color, ignoring the backdrop. |
| DIB_BLEND_MULTIPLY | 1 | Multiplies the backdrop and source color values. |
| DIB_BLEND_SCREEN | 2 | Multiplies the complements of the backdrop and source color values, then complements the result. |
| DIB_BLEND_OVERLAY | 3 | Multiplies or screens the colors, depending on the backdrop color value. |
| DIB_BLEND_DARKEN | 4 | Selects the darker of the backdrop and source colors. |
| DIB_BLEND_LIGHTEN | 5 | Selects the lighter of the backdrop and source colors. |
| DIB_BLEND_COLORDODGE | 6 | Brightens the backdrop color to reflect the source color. |
| DIB_BLEND_COLORBURN | 7 | Darkens the backdrop color to reflect the source color. |
| DIB_BLEND_UNSUPPORTED | -1 | Unsupport type. |
| PDSDK_FONT_FIXED_PITCH | 0x01 | — |
| PDSDK_FONT_SERIF | 0x02 | — |
| PDSDK_FONT_SYMBOLIC | 0x04 | — |
| PDSDK_FONT_SCRIPT | 0x08 | — |
| PDSDK_FONT_ITALIC | 0x40 | — |
| PDSDK_FONT_BOLD | 0x40000 | — |
| PDSDK_FONT_CIDFONT_CHARSET | 0x100000 | — |
| PDSDK_FONT_ANSI_CHARSET | 0 | — |
| PDSDK_FONT_DEFAULT_CHARSET | 1 | — |
| PDSDK_FONT_SYMBOL_CHARSET | 2 | — |
| PDSDK_FONT_SHIFTJIS_CHARSET | 128 | Jpanese |
| PDSDK_FONT_HANGEUL_CHARSET | 129 | Korean |
| PDSDK_FONT_GB2312_CHARSET | 134 | Chinese simple |
| PDSDK_FONT_CHINESEBIG5_CHARSET | 136 | Chinese trade |
| PDSDK_FONT_THAI_CHARSET | 222 | Tailand |
| PDSDK_FONT_EASTEUROPE_CHARSET | 238 | East Uropean |
| PDSDK_FONT_RUSSIAN_CHARSET | 204 | Russian |
| PDSDK_FONT_GREEK_CHARSET | 161 | Greek |
| PDSDK_FONT_TURKISH_CHARSET | 162 | Tukish |
| PDSDK_FONT_VIETNAMESE_CHARSET | 163 | Vietnamese |
| PDSDK_FONT_HEBREW_CHARSET | 177 | Heberew |
| PDSDK_FONT_ARABIC_CHARSET | 178 | Arabic |
| PDSDK_FONT_BALTIC_CHARSET | 186 | Baltic |
| PDSDK_FONT_FF_FIXEDPITCH | 1 | — |
| PDSDK_FONT_FF_ROMAN | (1<<4) | — |
| PDSDK_FONT_FF_SCRIPT | (4<<4) | — |
| PDSDK_FONT_FW_NORMAL | 400 | — |
| PDSDK_FONT_FW_BOLD | 700 | — |
| PDSDK_FONT_TYPE1 | 1 | Type1. |
| PDSDK_FONT_TRUETYPE | 2 | Truetype. |
| PDSDK_FONT_TYPE3 | 3 | Type3. |
| PDSDK_FONT_CIDFONT | 4 | CID font. |
| PDSDK_CIDSET_UNKNOWN | 0 | Unknown. |
| PDSDK_CIDSET_GB1 | 1 | Adobe-GB1. |
| PDSDK_CIDSET_CNS1 | 2 | Adobe-CNS1. |
| PDSDK_CIDSET_JAPAN1 | 3 | Adobe-Japan1. |
| PDSDK_CIDSET_KOREA1 | 4 | Adobe-Korea1. |
| PDSDK_CIDSET_UNICODE | 5 | Unicode. |
| PDSDK_FONT_FIXEDPITCH | 1 | All glyphs have the same width. |
| PDSDK_FONT_SERIF | 2 | Glyphs have serifs |
| PDSDK_FONT_SYMBOLIC | 4 | Glyphs outside the Adobe standard Latin character set. |
| PDSDK_FONT_SCRIPT | 8 | Glyphs resemble cursive handwriting. |
| PDSDK_FONT_NONSYMBOLIC | 32 | Adobe standard Latin character set or a subset of it. |
| PDSDK_FONT_ITALIC | 64 | Glyphs have dominant vertical strokes that are slanted. |
| PDSDK_FONT_ALLCAP | 0x10000 | No lowercase letters. |
| PDSDK_FONT_SMALLCAP | 0x20000 | Both uppercase and lowercase letters. |
| PDSDK_FONT_FORCEBOLD | 0x40000 | Force bold even at very small text sizes. |
| PDSDK_FONT_USEEXTERNATTR | 0x80000 | Additional font flag |
| NEEDTOPAUSE_NO | 0 | — |
| NEEDTOPAUSE_YES | 1 | — |
| PDSDK_PT_LINETO | 0x02 | — |
| PDSDK_PT_BEZIERTO | 0x04 | — |
| PDSDK_PT_MOVETO | 0x06 | — |
| PDSDK_PT_TYPE | 0x06 | — |
| PDSDK_FILL_ALTERNATE | 1 | — |
| PDSDK_FILL_WINDING | 2 | — |
| PDF_CARET_LEFT | -1 | The previous caret. |
| PDF_CARET_RIGHT | 1 | The next caret. |
| PDF_CARET_UP | -2 | The upon caret. |
| PDF_CARET_DOWN | 2 | The 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;
Métodos(21)
| Firma | Descripción |
|---|---|
| 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 .
Parámetros
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.
Parámetros
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.
Parámetros
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.
Parámetros
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.
Parámetros
point(in,out) — The input point, and It receives the output transformed point.
TransformPoint
void TransformPoint(PDSDK_Point* point) = 0;
Transform a point.
Parámetros
point(in,out) — The input point, and It receives the output transformed point.
TransformRect
void TransformRect(PDSDK_FloatRect* rect) = 0;
Transform a rectangle.
Parámetros
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.
Parámetros
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.
Parámetros
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.
Parámetros
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.
Parámetros
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.
Parámetros
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.
Parámetros
m(in) — The input matrix.
Translate
void Translate(float x, float y, int bPrepended = 0) = 0;
Translate the matrix.
Parámetros
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.
Métodos(12)
| Firma | Descripción |
|---|---|
| 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.
Devuelve:A cloned bitmap.
Clear
void Clear(unsigned int clr) = 0;
Fill bitmap with specified color.
Parámetros
clr(in) — The specified color to fill.
GetBpp
int GetBpp() = 0;
Get the number of BITS per pixel.
Devuelve:The number of bits per pixel.
GetPixels
unsigned char* GetPixels() = 0;
Get a pixels buffer.
Devuelve: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.
Parámetros
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.
Parámetros
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.
Parámetros
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.
Parámetros
pOtherBuf(in/out) — The pixel buffer to receive the pixel data.len(in) — Number of bytes for pOtherBuf.
class IPDF_Font
PDF font interface.
Métodos(16)
| Firma | Descripción |
|---|---|
| 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.
Devuelve:The font type.
IsEmbbedded
int IsEmbbedded() = 0;
Check whether the font is an embedded font.
Devuelve:Zero for Non-embbedded, otherwise embbedded.
GetCharset
int GetCharset() = 0;
Get the charset.
Devuelve:The charset.
IsItalic
int IsItalic() = 0;
Check whether the font is italic.
Devuelve:Zero for normal, otherwise italic.
IsBold
int IsBold() = 0;
Check whether the font is bold.
Devuelve:Zero for normal, otherwise bold.
IsVertical
int IsVertical() = 0;
Check whether the font is vertical.
Devuelve:Zero for normal, otherwise it is vertical.
Equal
int Equal(IPDF_Font* other) = 0;
Check whether the font is equle as other font.
Devuelve: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.
Parámetros
ch(in) — The unicode charcode.
Devuelve:Zero means the font does not contain the character, otherwise contain.
GetCharWidthF
float GetCharWidthF(unsigned long charcode) = 0;
Get a character's PDF width.
Parámetros
charcode(in) — Input a character code.
Devuelve:The PDF width of the character.
FindSubstFont
IPDF_Font* FindSubstFont(int charset) = 0;
Find a subsitiation font.
Parámetros
charset(in) — The input charset.
Devuelve:The subsitiation font.
class IPDF_Pause
Simple pause interface. Must be implemented by customer.
Métodos(1)
| Firma | Descripción |
|---|---|
| NeedToPause() | Do we need to pause now ? |
NeedToPause
public: virtual int NeedToPause() = 0;
Do we need to pause now ?
Devuelve:Non-zero means we need, otherwise we need not.
class IPDF_Progress
Simple progress interface. Must be implemented by customer.
Métodos(3)
| Firma | Descripción |
|---|---|
| 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?
Devuelve:Non-zero means cancel, otherwise not cacel.
SetRange
void SetRange(float min, float max) = 0;
Set the range of progress.
Parámetros
min(in) — The minimized value.max(in) — The maximized value.
SetCurPos
void SetCurPos(float pos) = 0;
Set current position of progress.
Parámetros
pos(in) — Current position.