|
| fz_stream * | fz_open_file_ptr_no_close (fz_context *ctx, FILE *file) |
| |
| static fz_stream * | mupdf_attach_stream (struct caps_rasterizer *rstr, int *rc) |
| |
| static int | mupdf_init (struct caps_rasterizer *rstr) |
| |
| static int | mupdf_detach (struct caps_rasterizer *rstr) |
| |
| static int | mupdf_job_start (struct caps_rasterizer *rstr, unsigned *page_count) |
| |
| static int | _mupdf_page_number_get (const struct rstr_print_state *state) |
| |
| static int | mupdf_page_get_next (struct caps_rasterizer *rstr) |
| |
| static fz_rect | caps_rect_2_fz_rec (const struct caps_rect *rect) |
| |
| static fz_matrix | _fz_transform_matrix_create (struct caps_rect rect, double resx, double resy, double rotate) |
| |
| static fz_rect | caps_area_2_fz_rec (const struct caps_rect *sz, const struct caps_area *area) |
| |
| static int | mupdf_page_rasterize (struct caps_rasterizer *rstr, const struct caps_rstr_page *page_conf, struct raster_adapt_preparation *setup) |
| |
| static int | mupdf_image_get (struct caps_rasterizer *rstr, struct caps_rstr_raster *desc) |
| |
| static const void * | mupdf_line_get (struct caps_rasterizer *rstr, const struct caps_rstr_raster *desc, unsigned line_no) |
| |
- Author
- Jürgen Borleis
- Copyright
- GPL-2.0 or later at your opinion
- Version
- 1.0.0
- Warning
- Use as experimental
Install
- libmupdf-dev
- libopenjp2-7-dev
- libjbig2dec0-dev
- libharfbuzz-dev
Provide a /usr/lib/pkgconfig/mupdf.pc:
Name: mupdf
Description: Library for rendering PDF documents
Requires.private: freetype2 jbig2dec libopenjp2 libjpeg harfbuzz
Version: 1.15.0
Libs: -L${libdir} -lmupdf
Libs.private: -lmupdf-third
Cflags: -I${includedir}
Or build the mupdf from its source repository. In this case it will be one huge monolitic block of code.
| static fz_stream * mupdf_attach_stream |
( |
struct caps_rasterizer * |
rstr, |
|
|
int * |
rc |
|
) |
| |
|
static |
Convert a regular file descriptor into what muPDF wants to access the document's file
- Parameters
-
| [in,out] | rstr | Our context |
| [out] | rc | Negative errno in case of a failure |
- Return values
-
| Pointer | Stream representation for muPDF |
| NULL | In case of a failure. In this case *rc contains a valid negative errno |
In the CAPS universe the document is already open…as a file descriptor. In order to connect muPDF to it, we need a stream. And additionally a workaround.
muPDF doesn't support using an already open stream as its document input. But it has an internal function doing so. This function isn't exported via its API header file, but it is still available to link to.
This function wraps this feature for the case in future releases fz_open_file_ptr_no_close() isn't available anymore. Or its implementation changes over releases...
According to some header comments, there should be a function called fz_open_fd() … but it isn't.