diff --git a/AUTHORS b/AUTHORS
index f5f8430..371ebf1 100644
a
|
b
|
Sebastian Ramacher <s.ramacher@gmx.at> |
5 | 5 | |
6 | 6 | Other contributors are (in alphabetical order): |
7 | 7 | |
| 8 | Christian Hesse <mail@eworm.de> |
8 | 9 | Pavel Borzenkov <pavel.borzenkov@gmail.com> |
9 | 10 | William Skeith <wes@cs.ccny.cuny.edu> |
diff --git a/config.mk b/config.mk
index cba8d40..6407ae6 100644
a
|
b
|
endif |
32 | 32 | OPENSSL_INC ?= $(shell pkg-config --cflags libcrypto) |
33 | 33 | OPENSSL_LIB ?= $(shell pkg-config --libs libcrypto) |
34 | 34 | |
35 | | MUPDF_LIB ?= -lmupdf -lmujs |
| 35 | MUPDF_LIB ?= -lmupdf -lmupdfthird |
36 | 36 | |
37 | 37 | INCS = ${GTK_INC} ${GIRARA_INC} ${OPENSSL_INC} ${ZATHURA_INC} |
38 | 38 | LIBS = ${GTK_LIB} ${GIRARA_LIB} ${MUPDF_LIB} ${OPENSSL_LIB} -ljbig2dec -lopenjp2 -ljpeg |
diff --git a/document.c b/document.c
index 873866c..8d0aae4 100644
a
|
b
|
pdf_document_save_as(zathura_document_t* document, mupdf_document_t* |
109 | 109 | } |
110 | 110 | |
111 | 111 | fz_try (mupdf_document->ctx) { |
112 | | /* fz_write_document claims to accepts NULL as third argument but doesn't. |
113 | | * pdf_write_document does not check if the third arguments is NULL for some |
114 | | * options. */ |
115 | | |
116 | | fz_write_options opts = { 0 }; /* just use the default options */ |
117 | | fz_write_document(mupdf_document->ctx, mupdf_document->document, (char*) path, &opts); |
| 112 | pdf_save_document(mupdf_document->ctx, (pdf_document*) mupdf_document->document, (char*) path, NULL); |
118 | 113 | } fz_catch (mupdf_document->ctx) { |
119 | 114 | return ZATHURA_ERROR_UNKNOWN; |
120 | 115 | } |
diff --git a/image.c b/image.c
index 97d4143..8f6912b 100644
a
|
b
|
pdf_page_image_get_cairo(zathura_page_t* page, mupdf_page_t* mupdf_page, |
93 | 93 | fz_pixmap* pixmap = NULL; |
94 | 94 | cairo_surface_t* surface = NULL; |
95 | 95 | |
96 | | pixmap = fz_new_pixmap_from_image(mupdf_page->ctx, mupdf_image, 0, 0); |
| 96 | pixmap = fz_get_pixmap_from_image(mupdf_page->ctx, mupdf_image, 0, 0); |
97 | 97 | if (pixmap == NULL) { |
98 | 98 | goto error_free; |
99 | 99 | } |
diff --git a/page.c b/page.c
index beb0351..219fc2a 100644
a
|
b
|
pdf_page_init(zathura_page_t* page) |
43 | 43 | /* setup text */ |
44 | 44 | mupdf_page->extracted_text = false; |
45 | 45 | |
46 | | mupdf_page->text = fz_new_text_page(mupdf_page->ctx); |
| 46 | mupdf_page->text = fz_new_stext_page(mupdf_page->ctx); |
47 | 47 | if (mupdf_page->text == NULL) { |
48 | 48 | goto error_free; |
49 | 49 | } |
50 | 50 | |
51 | | mupdf_page->sheet = fz_new_text_sheet(mupdf_page->ctx); |
| 51 | mupdf_page->sheet = fz_new_stext_sheet(mupdf_page->ctx); |
52 | 52 | if (mupdf_page->sheet == NULL) { |
53 | 53 | goto error_free; |
54 | 54 | } |
… |
… |
pdf_page_clear(zathura_page_t* page, mupdf_page_t* mupdf_page) |
74 | 74 | |
75 | 75 | if (mupdf_page != NULL) { |
76 | 76 | if (mupdf_page->text != NULL) { |
77 | | fz_drop_text_page(mupdf_page->ctx, mupdf_page->text); |
| 77 | fz_drop_stext_page(mupdf_page->ctx, mupdf_page->text); |
78 | 78 | } |
79 | 79 | |
80 | 80 | if (mupdf_page->sheet != NULL) { |
81 | | fz_drop_text_sheet(mupdf_page->ctx, mupdf_page->sheet); |
| 81 | fz_drop_stext_sheet(mupdf_page->ctx, mupdf_page->sheet); |
82 | 82 | } |
83 | 83 | |
84 | 84 | if (mupdf_page->page != NULL) { |
diff --git a/plugin.h b/plugin.h
index f2fb4a0..84c5e53 100644
a
|
b
|
typedef struct mupdf_page_s |
21 | 21 | { |
22 | 22 | fz_page* page; /**< Reference to the mupdf page */ |
23 | 23 | fz_context* ctx; /**< Context */ |
24 | | fz_text_sheet* sheet; /**< Text sheet */ |
25 | | fz_text_page* text; /**< Page text */ |
| 24 | fz_stext_sheet* sheet; /**< Text sheet */ |
| 25 | fz_stext_page* text; /**< Page text */ |
26 | 26 | fz_rect bbox; /**< Bbox */ |
27 | 27 | bool extracted_text; /**< If text has already been extracted */ |
28 | 28 | } mupdf_page_t; |
diff --git a/search.c b/search.c
index 3a9fad4..c672b9f 100644
a
|
b
|
pdf_page_search_text(zathura_page_t* page, mupdf_page_t* mupdf_page, const char* |
40 | 40 | } |
41 | 41 | |
42 | 42 | fz_rect* hit_bbox = fz_malloc_array(mupdf_page->ctx, N_SEARCH_RESULTS, sizeof(fz_rect)); |
43 | | int num_results = fz_search_text_page(mupdf_page->ctx, mupdf_page->text, |
| 43 | int num_results = fz_search_stext_page(mupdf_page->ctx, mupdf_page->text, |
44 | 44 | (char*) text, hit_bbox, N_SEARCH_RESULTS); |
45 | 45 | |
46 | 46 | for (int i = 0; i < num_results; i++) { |
diff --git a/utils.c b/utils.c
index 4a003b9..a4b9320 100644
a
|
b
|
mupdf_page_extract_text(mupdf_document_t* mupdf_document, mupdf_page_t* mupdf_pa |
14 | 14 | fz_device* text_device = NULL; |
15 | 15 | |
16 | 16 | fz_try (mupdf_page->ctx) { |
17 | | text_device = fz_new_text_device(mupdf_page->ctx, mupdf_page->sheet, mupdf_page->text); |
| 17 | text_device = fz_new_stext_device(mupdf_page->ctx, mupdf_page->sheet, mupdf_page->text); |
18 | 18 | |
19 | 19 | /* Disable FZ_IGNORE_IMAGE to collect image blocks */ |
20 | 20 | fz_disable_device_hints(mupdf_page->ctx, text_device, FZ_IGNORE_IMAGE); |