00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PDFCORE_H_
00020 #define PDFCORE_H_
00021
00022 #include "poppler/GlobalParams.h"
00023 #include "poppler/PDFDoc.h"
00024 #include "poppler/SplashOutputDev.h"
00025 #include "poppler/ErrorCodes.h"
00026 #include "poppler/Gfx.h"
00027 #include "splash/SplashBitmap.h"
00028 #include "splash/SplashTypes.h"
00029 #include "goo/GooString.h"
00030 #include "PageInfo.h"
00031 #include "poppler/SecurityHandler.h"
00032
00033 struct Controller;
00035
00036
00037
00038
00040 class CPDFCore
00041 {
00042 private:
00043 PDFDoc * pdfdoc;
00044 SplashOutputDev * outputDev;
00045 TextOutputDev * textOut;
00046 Controller * ctrl;
00047
00048 protected:
00049 void calculateLayout(CPageInfo & info);
00050 void getPageBasicInfo(CPageInfo & info);
00051
00052 public:
00053 CPDFCore(SplashColorMode colorModeA, int bitmapRowPadA,
00054 GBool reverseVideoA, SplashColorPtr paperColorA);
00055 ~CPDFCore(void);
00056
00057 void setController(struct Controller * c){ctrl = c; }
00058 int open(GooString *fileNameA, GooString *ownerPassword = NULL,
00059 GooString *userPassword = NULL, void *guiDataA = NULL);
00060 int open(BaseStream *stream, GooString *ownerPassword = NULL,
00061 GooString *userPassword = NULL, void *guiDataA = NULL);
00062 void close();
00063 RenderRet renderPage(CPageInfo & info, GBool useMediaBox,
00064 GBool crop, GBool doLinks, GBool (*abortCheckCbk)(void *data) = NULL,
00065 void *abortCheckCbkData = NULL);
00066 PDFDoc * getPDFDoc() { return pdfdoc; }
00067 int getNumPages();
00068
00069
00070 double getZoomMax(const int pageNumber);
00071 int getPageType(const int pageNumber);
00072 double verifyZoomMax(double zoom, const int pageNumber);
00073
00074
00075 double getPageWidth(const int pageNumber);
00076 double getPageHeight(const int pageNumber);
00077 int getPageRotate(const int pageNumber);
00078 };
00079
00080 #endif