00001 00018 #ifndef _FPDFOBJECTEDIT_H_ 00019 #define _FPDFOBJECTEDIT_H_ 00020 00021 #ifdef _WIN32 00022 00023 #define DLLEXPORT __declspec( dllexport ) 00024 #define STDCALL __stdcall 00025 #else 00026 #define DLLEXPORT 00027 #define STDCALL 00028 #endif 00029 00030 #ifdef __cplusplus 00031 extern "C" { 00032 #endif 00033 00034 #include "fpdfview.h" 00035 #include "fpdfeditbase.h" 00036 00041 DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewTextObj(); 00042 00052 DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewTextObjEx(FPDF_WIDESTRING text, int nwSize, FPDF_FONT font); 00053 00059 DLLEXPORT FPDF_FONT STDCALL FPDFTextObj_GetFont(FPDF_PAGEOBJECT text_object); 00060 00071 DLLEXPORT void STDCALL FPDFTextObj_SetFont(FPDF_PAGEOBJECT text_object, FPDF_FONT font, double font_size); 00072 00079 DLLEXPORT double STDCALL FPDFTextObj_GetFontSize(FPDF_PAGEOBJECT text_object); 00080 00093 DLLEXPORT void STDCALL FPDFTextObj_GetMatrix(FPDF_PAGEOBJECT text_object, 00094 double* a, double* b, double* c, double* d, double* e, double* f); 00095 00108 DLLEXPORT void STDCALL FPDFTextObj_SetMatrix(FPDF_PAGEOBJECT text_object, 00109 double a, double b, double c, double d, double e, double f); 00110 00111 00118 DLLEXPORT int STDCALL FPDFTextObj_CountChars(FPDF_PAGEOBJECT text_object); 00119 00127 DLLEXPORT unsigned int STDCALL FPDFTextObj_GetUincode(FPDF_PAGEOBJECT text_object, int index); 00128 00137 DLLEXPORT FPDF_BOOL STDCALL FPDFTextObj_SetUnicode(FPDF_PAGEOBJECT text_object,int index, int nUnicode); 00138 00146 DLLEXPORT double STDCALL FPDFTextObj_GetOffset(FPDF_PAGEOBJECT text_object, int index); 00147 00153 #define FPDF_TEXTMODE_FILL 0 00154 00155 #define FPDF_TEXTMODE_STROKE 1 00156 00157 #define FPDF_TEXTMODE_FILLANDSTROKE 2 00158 00159 #define FPDF_TEXTMODE_INVISIBLE 3 00160 00169 DLLEXPORT int STDCALL FPDFTextObj_GetTextMode(FPDF_PAGEOBJECT text_object); 00170 00178 DLLEXPORT FPDF_BOOL STDCALL FPDFTextObj_SetTextMode(FPDF_PAGEOBJECT text_object, int text_mode); 00179 00187 DLLEXPORT double STDCALL FPDFTextObj_GetCharSpace(FPDF_PAGEOBJECT text_object); 00188 00197 DLLEXPORT FPDF_BOOL STDCALL FPDFTextObj_SetCharSpace(FPDF_PAGEOBJECT text_object, double charspace); 00198 00206 DLLEXPORT double STDCALL FPDFTextObj_GetWordSpace(FPDF_PAGEOBJECT text_object); 00207 00215 DLLEXPORT FPDF_BOOL STDCALL FPDFTextObj_SetWordSpace(FPDF_PAGEOBJECT text_object, double wordspace); 00216 00217 00228 DLLEXPORT int STDCALL FPDFTextObj_Insert(FPDF_PAGEOBJECT text_object, FPDF_WIDESTRING text, int nwSize, int index); 00229 00240 DLLEXPORT int STDCALL FPDFTextObj_Delete(FPDF_PAGEOBJECT text_object, int index, int nCount = 1); 00241 00253 DLLEXPORT int STDCALL FPDFTextObj_Find(FPDF_PAGEOBJECT text_object, FPDF_WIDESTRING text, int nwSize, int nStart = 0); 00254 00265 DLLEXPORT int STDCALL FPDFTextObj_Replace(FPDF_PAGEOBJECT text_object, FPDF_WIDESTRING OldText, int nwOldSize, 00266 FPDF_WIDESTRING NewText, int nwNewSize); 00267 00276 DLLEXPORT FPDF_BOOL STDCALL FPDFTextObj_Compare(FPDF_PAGEOBJECT text_object, FPDF_WIDESTRING text, int nwSize); 00277 00283 DLLEXPORT FPDF_BYTESTRING STDCALL FPDFFont_GetFontName(FPDF_FONT font); 00284 00290 #define FPDF_FLAG_FIXEDPITCH 1 00291 00292 #define FPDF_FLAG_SERIF 2 00293 00294 #define FPDF_FLAG_SYMBOLIC 4 00295 00296 #define FPDF_FLAG_SCRIPT 8 00297 00298 #define FPDF_FLAG_NONSYMBOLIC 32 00299 00300 #define FPDF_FLAG_ITALIC 64 00301 00302 #define FPDF_FLAG_ALLCAP 0x10000 00303 00304 #define FPDF_FLAG_SMALLCAP 0x20000 00305 00306 #define FPDF_FLAG_FORCEBOLD 0x40000 00307 00316 DLLEXPORT int STDCALL FPDFFont_GetFlags(FPDF_FONT font); 00317 00327 DLLEXPORT void STDCALL FPDFFont_GetBBox(FPDF_FONT font, double* left, double* right, double* bottom, double* top); 00328 00339 DLLEXPORT void STDCALL FPDFFont_GetCharBBox(FPDF_FONT font, FPDF_DWORD char_code, double* left, double* right, double* bottom, double* top); 00340 00347 DLLEXPORT int STDCALL FPDFFont_GetCharWidth(FPDF_FONT font, FPDF_DWORD char_code); 00348 00355 DLLEXPORT unsigned short STDCALL FPDFFont_GetUnicode(FPDF_FONT font, FPDF_DWORD char_code); 00356 00363 DLLEXPORT int STDCALL FPDFFont_GetCharSize(FPDF_FONT font, FPDF_DWORD char_code); 00364 00371 DLLEXPORT FPDF_DWORD STDCALL FPDFFont_GetCharCode(FPDF_FONT font, unsigned short unicode); 00372 00380 DLLEXPORT int STDCALL FPDFFont_GetFontDescent (FPDF_FONT font); 00381 00389 DLLEXPORT int STDCALL FPDFFont_GetFontAscent(FPDF_FONT font); 00390 00395 typedef struct tagFPDFLOGFONT { 00396 00402 long lfWeight; 00406 unsigned char lfItalic; 00410 unsigned char lfCharSet; 00414 unsigned char lfPitchAndFamily; 00418 char lfFaceName[32]; 00419 } FPDFLOGFONT, *PFPDFLOGFONT; 00428 DLLEXPORT FPDF_FONT STDCALL FPDFFont_AddTrueType(FPDF_DOCUMENT document, PFPDFLOGFONT pLogFont); 00429 00435 #define FPDF_ENCODING_DEFAULT 0 00436 00437 #define FPDF_ENCODING_WINANSI 1 00438 00439 #define FPDF_ENCODING_MACROMAN 2 00440 00441 #define FPDF_ENCODING_MACEXPERT 3 00442 00443 #define FPDF_ENCODING_STANDARD 4 00444 00445 #define FPDF_ENCODING_IDENTITY 10 00446 00447 #define FPDF_ENCODING_GB 11 00448 00449 #define FPDF_ENCODING_BIG5 12 00450 00451 #define FPDF_ENCODING_SHIFT_JIS 13 00452 00453 #define FPDF_ENCODING_KOREAN 14 00454 00463 DLLEXPORT FPDF_FONT STDCALL FPDFFont_AddStandardFont(FPDF_DOCUMENT document, char* font_name, int encoding); 00464 00469 DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewPathObj(); 00470 00478 #define FPDF_PATH_CLOSEFIGURE 1 00479 00480 #define FPDF_PATH_LINETO 2 00481 00482 #define FPDF_PATH_BEZIERTO 4 00483 00484 #define FPDF_PATH_MOVETO 6 00485 00496 DLLEXPORT void STDCALL FPDFPathObj_SetPoints(FPDF_PAGEOBJECT path_object, int point_count, double* point_x, double* point_y, int* flags); 00497 00507 DLLEXPORT void STDCALL FPDFPathObj_InsertPoint(FPDF_PAGEOBJECT path_object, double x, double y, int flag, int point_index = -1); 00508 00515 DLLEXPORT void STDCALL FPDFPathObj_RemovePoint(FPDF_PAGEOBJECT path_object, int point_index); 00516 00522 DLLEXPORT void STDCALL FPDFPathObj_ClearPoints(FPDF_PAGEOBJECT path_object); 00523 00529 DLLEXPORT int STDCALL FPDFPathObj_CountPoints(FPDF_PAGEOBJECT path_object); 00530 00537 DLLEXPORT int STDCALL FPDFPathObj_GetPointType(FPDF_PAGEOBJECT path_object, int point_index); 00538 00545 DLLEXPORT double STDCALL FPDFPathObj_GetPointX(FPDF_PAGEOBJECT path_object, int point_index); 00546 00553 DLLEXPORT double STDCALL FPDFPathObj_GetPointY(FPDF_PAGEOBJECT path_object, int point_index); 00554 00560 DLLEXPORT FPDF_PATH STDCALL FPDFPathObj_GetPath(FPDF_PAGEOBJECT path_object); 00561 00567 DLLEXPORT FPDF_BOOL STDCALL FPDFPathObj_GetStroke(FPDF_PAGEOBJECT path_object); 00568 00574 #define FPDF_FILL_NULL 0 00575 00576 #define FPDF_FILL_ALTERNATE 1 00577 00578 #define FPDF_FILL_WINDING 2 00579 00586 DLLEXPORT int STDCALL FPDFPathObj_GetFillMode(FPDF_PAGEOBJECT path_object); 00587 00595 DLLEXPORT void STDCALL FPDFPathObj_SetFillStroke(FPDF_PAGEOBJECT path_object, int fill_type, int stroke); 00596 00608 DLLEXPORT FPDF_BOOL STDCALL FPDFPathObj_GetMatrix(FPDF_PAGEOBJECT path_object, 00609 double* a, double* b, double* c, double* d,double* e, double* f); 00610 00622 DLLEXPORT FPDF_BOOL STDCALL FPDFPathObj_SetMatrix(FPDF_PAGEOBJECT path_object, 00623 double a, double b, double c, double d, double e, double f); 00624 00632 DLLEXPORT void STDCALL FPDFFormObj_InsertSubObject(FPDF_PAGEOBJECT form_object, FPDF_PAGEOBJECT page_obj); 00633 00646 DLLEXPORT void STDCALL FPDFFormObj_Display(FPDF_PAGEOBJECT form_object,void* device,int xPos,int yPos,int xSize, int ySize,int iRotate); 00647 00654 DLLEXPORT void STDCALL FPDFFormObj_DeleteSubObject(FPDF_PAGEOBJECT form_object, int index); 00655 00661 DLLEXPORT int STDCALL FPDFFormObj_CountSubObjects(FPDF_PAGEOBJECT form_object); 00662 00669 DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFFormObj_GetSubObject(FPDF_PAGEOBJECT form_object, int index); 00670 00678 DLLEXPORT int STDCALL FPDFFormObj_GetSubObjectIndex(FPDF_PAGEOBJECT form_object, FPDF_PAGEOBJECT page_obj); 00679 00687 DLLEXPORT FPDF_BOOL STDCALL FPDFFormObj_GenerateContent(FPDF_PAGEOBJECT form_object); 00688 00700 DLLEXPORT FPDF_BOOL STDCALL FPDFFormObj_GetMatrix(FPDF_PAGEOBJECT form_object, 00701 double* a, double* b, double* c, double* d,double* e, double* f); 00702 00708 DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document); 00709 00718 DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadFromFile(FPDF_PAGE* pages, int nCount,FPDF_PAGEOBJECT image_object, FPDF_BYTESTRING filename); 00719 00737 DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_GetMatrix(FPDF_PAGEOBJECT image_object, 00738 double* a, double* b, double* c, double* d,double* e, double* f); 00739 00751 DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object, 00752 double a, double b, double c, double d, double e, double f); 00753 00759 DLLEXPORT FPDF_BITMAP STDCALL FPDFImageObj_GetBitmap(FPDF_PAGEOBJECT image_object); 00760 00769 DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,int nCount,FPDF_PAGEOBJECT image_object, FPDF_BITMAP bitmap); 00770 00775 #define HIGHLIGHT_NONE 0 00776 #define HIGHLIGHT_INVERT 1 00777 #define HIGHLIGHT_OUTLINE 2 00778 #define HIGHLIGHT_PUSH 3 00779 00785 #define BORDERSTYLE_SOLID 0 00786 #define BORDERSTYLE_DASHED 1 00787 #define BORDERSTYLE_BEVELED 2 00788 #define BORDERSTYLE_INSET 3 00789 #define BORDERSTYLE_UNDERLINE 4 00790 00799 DLLEXPORT FPDF_LINK STDCALL FPDFLinkObj_NewLinkObj(FPDF_DOCUMENT document,int nsrcPageIndex,double lx,double ly, double ux, double uy); 00800 00808 DLLEXPORT FPDF_BOOL STDCALL FPDFLinkObj_DelLinkObj(FPDF_DOCUMENT document,FPDF_PAGE page,FPDF_LINK link); 00809 00817 DLLEXPORT FPDF_BOOL STDCALL FPDFLinkObj_SetAction(FPDF_DOCUMENT document,FPDF_LINK link,FPDF_ACTION action); 00818 00824 DLLEXPORT int STDCALL FPDFLinkObj_CountLink(FPDF_PAGE page); 00825 00832 DLLEXPORT FPDF_LINK STDCALL FPDFLinkObj_GetLink(FPDF_PAGE page,int index); 00833 00843 DLLEXPORT void STDCALL FPDFLinkObj_GetRect(FPDF_LINK link, 00844 double* left, double* top, double* right, double* bottom); 00845 00846 #ifdef __cplusplus 00847 }; 00848 #endif 00849 00850 #endif 00851 00852