Module ffi.mupdf
MuPDF API
This is a FFI wrapper for what was a Lua-based API in the past Some kind of C wrapper is needed for muPDF since muPDF uses a setjmp/longjmp based approach to error/exception handling.
That's one of the very few things we can't deal with using LuaJIT's FFI.
Functions
openDocument (filename, cache_size) | Opens a document. |
renderImage (data, size, width, height) | Renders image data. |
renderImageFile (filename, width, height) | Renders image file. |
scaleBlitBuffer (bb, width, height) | Scales a blitbuffer. |
Functions
- openDocument (filename, cache_size)
-
Opens a document.
Parameters:
- filename
- cache_size
- renderImage (data, size, width, height)
-
Renders image data.
Parameters:
- data
- size
- width
- height
- renderImageFile (filename, width, height)
-
Renders image file.
Parameters:
- filename
- width
- height
- scaleBlitBuffer (bb, width, height)
-
Scales a blitbuffer.
Quality of scaling done by MuPDF is better than the one done in blitbuffer.lua (see fzscalepixmap_cached() in mupdf/source/fitz/draw-scale-simple.c). Same arguments as BlitBuffer:scale() for easy replacement.
Parameters:
- bb
- width
- height We need first to convert our BlitBuffer to a pixmap