]> rtime.felk.cvut.cz Git - hornmich/skoda-qr-demo.git/blob - QRScanner/mobile/jni/pdf/pdf-xref-aux.c
Add MuPDF native source codes
[hornmich/skoda-qr-demo.git] / QRScanner / mobile / jni / pdf / pdf-xref-aux.c
1 #include "mupdf/pdf.h"
2
3 /*
4         These functions have been split out of pdf_xref.c to allow tools
5         to be linked without pulling in the interpreter. The interpreter
6         references the built-in font and cmap resources which are quite
7         big. Not linking those into the tools saves roughly 6MB in the
8         resulting executables.
9 */
10
11 pdf_document *
12 pdf_open_document_with_stream(fz_context *ctx, fz_stream *file)
13 {
14         pdf_document *doc = pdf_open_document_no_run_with_stream(ctx, file);
15         doc->super.run_page_contents = (fz_document_run_page_contents_fn *)pdf_run_page_contents;
16         doc->super.run_annot = (fz_document_run_annot_fn *)pdf_run_annot;
17         doc->update_appearance = pdf_update_appearance;
18         return doc;
19 }
20
21 pdf_document *
22 pdf_open_document(fz_context *ctx, const char *filename)
23 {
24         pdf_document *doc = pdf_open_document_no_run(ctx, filename);
25         doc->super.run_page_contents = (fz_document_run_page_contents_fn *)pdf_run_page_contents;
26         doc->super.run_annot = (fz_document_run_annot_fn *)pdf_run_annot;
27         doc->update_appearance = pdf_update_appearance;
28         return doc;
29 }
30
31 fz_document_handler pdf_document_handler =
32 {
33         (fz_document_recognize_fn *)&pdf_recognize,
34         (fz_document_open_fn *)&pdf_open_document,
35         (fz_document_open_with_stream_fn *)&pdf_open_document_with_stream
36 };