-
Notifications
You must be signed in to change notification settings - Fork 0
/
muconvert.h
50 lines (43 loc) · 1.04 KB
/
muconvert.h
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
#ifndef _MUCONVERT_H_
#define _MUCONVERT_H_
#include <mupdf/fitz.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* input options */
typedef struct input_opts
{
int alphabits;
float layout_w;
float layout_h;
float layout_em;
int layout_use_doc_css;
} input_opts;
/* output options */
typedef struct output_opts
{
int dehyphenate;
} output_opts;
typedef struct run_param
{
fz_context *ctx;
fz_document *doc;
fz_document_writer *out;
fz_box_type page_box;
int count;
} run_param;
/*
* Extract text from pdf named `filename`.
*
* Arguments:
* filename -- the path to the pdf
* dehyphenate -- nonzero to enable 'dehyphenate' option in mupdf
* data -- a large enough buffer to receive data from mupdf
* len -- as input, the size of `data`; as output, the size of the
* pdf data from mupdf
*
* Return:
* retcode -- 0 for success, 1 for error, 2 for buffer not big enough
*/
int pdftotext(const char *filename, int dehyphenate, unsigned char *data, size_t *len);
#endif