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.
|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.|
- 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.
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.
- height We need first to convert our BlitBuffer to a pixmap