forked from coolwanglu/pdf2htmlEX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPreprocessor.h
More file actions
62 lines (45 loc) · 1.36 KB
/
Copy pathPreprocessor.h
File metadata and controls
62 lines (45 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* Preprocessor.h
*
* PDF is so complicated that we have to scan twice
*
* Check used codes for each font
* Collect all used link destinations
*
* by WangLu
* 2012.09.07
*/
#ifndef PREPROCESSOR_H__
#define PREPROCESSOR_H__
#include <unordered_map>
#include <OutputDev.h>
#include <PDFDoc.h>
#include <Annot.h>
#include "Param.h"
namespace pdf2htmlEX {
class Preprocessor : public OutputDev {
public:
Preprocessor(const Param * param);
virtual ~Preprocessor(void);
void process(PDFDoc * doc);
virtual GBool upsideDown() { return gFalse; }
virtual GBool useDrawChar() { return gTrue; }
virtual GBool interpretType3Chars() { return gFalse; }
virtual GBool needNonText() { return gFalse; }
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);
virtual void startPage(int pageNum, GfxState *state);
const char * get_code_map (long long font_id) const;
double get_max_width (void) const { return max_width; }
double get_max_height (void) const { return max_height; }
protected:
const Param * param;
double max_width, max_height;
long long cur_font_id;
char * cur_code_map;
std::unordered_map<long long, char*> code_maps;
};
} // namespace pdf2htmlEX
#endif //PREPROCESSOR_H__