1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-10-06 12:01:39 +00:00
pdf2htmlEX/src/include/Preprocessor.h

58 lines
1.2 KiB
C
Raw Normal View History

2012-09-07 07:03:03 +00:00
/*
* Preprocessor.h
*
* PDF is so complicated that we have to scan twice
2012-09-07 07:03:03 +00:00
*
* Check used codes for each font
2012-09-22 06:41:29 +00:00
* Collect all used link destinations
2012-09-07 07:03:03 +00:00
*
* by WangLu
* 2012.09.07
*/
#ifndef PREPROCESSOR_H__
#define PREPROCESSOR_H__
2012-09-07 07:03:03 +00:00
#include <unordered_map>
#include <OutputDev.h>
2012-09-22 06:41:29 +00:00
#include <PDFDoc.h>
#include <Annot.h>
#include "Param.h"
2012-09-07 07:03:03 +00:00
namespace pdf2htmlEX {
class Preprocessor : public OutputDev {
2012-09-07 07:03:03 +00:00
public:
2012-09-22 06:41:29 +00:00
Preprocessor(const Param * param);
virtual ~Preprocessor(void);
2012-09-07 07:03:03 +00:00
2012-09-22 06:41:29 +00:00
void process(PDFDoc * doc);
2012-09-07 07:03:03 +00:00
virtual GBool upsideDown() { return gFalse; }
virtual GBool useDrawChar() { return gTrue; }
virtual GBool interpretType3Chars() { return gFalse; }
virtual GBool needNonText() { return gFalse; }
2012-09-22 06:41:29 +00:00
2012-09-07 07:03:03 +00:00
virtual void drawChar(GfxState *state, double x, double y,
double dx, double dy,
double originX, double originY,
CharCode code, int nBytes, Unicode *u, int uLen);
const char * get_code_map (long long font_id) const;
protected:
2012-09-22 06:41:29 +00:00
const Param * param;
2012-09-07 07:03:03 +00:00
long long cur_font_id;
char * cur_code_map;
std::unordered_map<long long, char*> code_maps;
};
} // namespace pdf2htmlEX
2012-09-07 07:03:03 +00:00
#endif //PREPROCESSOR_H__