10#define TEXTOUTPUTDEV_H
28#undef TEXTOUT_DO_SYMBOLS
32typedef void (*TextOutputFunc)( void *stream, char *text, int len);
47 TextString(GfxState *state, double x0, double y0,
52 virtual ~TextString();
55 virtual void addChar(GfxState *state, double x, double y,
56 double dx, double dy, Unicode u);
71 friend class TextPage;
72 friend class TextBlock;
73 friend class PDFImport::String;
74 friend class PDFImport::Page;
125 TextPage(GBool rawOrderA);
131 void updateFont(GfxState *state);
135 virtual void beginString(GfxState *state, double x0, double y0);
138 void addChar(GfxState *state, double x, double y,
139 double dx, double dy, Unicode *u, int uLen);
142 virtual void endString();
145 virtual void addString(TextString *str);
156 GBool findText(Unicode *s, int len,
157 GBool top, GBool bottom,
158 double *xMin, double *yMin,
159 double *xMax, double *yMax);
162 GString *getText( double xMin, double yMin,
163 double xMax, double yMax);
166 void dump( void *outputStream, TextOutputFunc outputFunc);
169 virtual void clear();
173 GBool xyBefore(TextString *str1, TextString *str2);
174 GBool xyBefore(TextBlock *blk1, TextBlock *blk2);
175 GBool yxBefore(TextBlock *blk1, TextBlock *blk2);
176 double coalesceFit(TextString *str1, TextString *str2);
183 TextString *xyStrings;
185 TextString *xyCur1, *xyCur2;
192 friend class PDFImport::Page;
199class TextOutputDev: public OutputDev {
205 TextOutputDev( char *fileName, GBool rawOrderA, GBool append);
209 TextOutputDev(TextOutputFunc func, void *stream, GBool rawOrderA);
212 virtual ~TextOutputDev();
215 virtual GBool isOk() { return ok; }
221 virtual GBool upsideDown() { return gTrue; }
224 virtual GBool useDrawChar() { return gTrue; }
228 virtual GBool interpretType3Chars() { return gFalse; }
231 virtual GBool needNonText() { return gFalse; }
236 virtual void startPage( int pageNum, GfxState *state);
239 virtual void endPage();
242 virtual void updateFont(GfxState *state);
245 virtual void beginString(GfxState *state, GString *s);
246 virtual void endString(GfxState *state);
247 virtual void drawChar(GfxState *state, double x, double y,
248 double dx, double dy,
249 double originX, double originY,
250 CharCode c, Unicode *u, int uLen);
261 GBool findText(Unicode *s, int len,
262 GBool top, GBool bottom,
263 double *xMin, double *yMin,
264 double *xMax, double *yMax);
267 GString *getText( double xMin, double yMin,
268 double xMax, double yMax);
272 TextOutputFunc outputFunc;
|