mupdf
Version, currently main branch1 version
- main branchlatestApr 4, 2026
github.com/jgaskins/mupdf
Crystal bindings to MuPDF
1 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
mupdf:
github: jgaskins/mupdf
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.19.1- License
- MIT
- Author
- Jamie Gaskins
Dependencies
This version declares no dependencies.
README
mupdf
Crystal bindings for MuPDF, a library for managing PDFs and converting them to and from other formats.
Installation
-
Add the dependency to your
shard.yml:dependencies: mupdf: github: jgaskins/mupdf -
Run
shards install
Usage
Convert PDFs to PNGs
require "mupdf"
# You need to instantiate it with the version of MuPDF you have installed.
converter = MuPDF::ImageConverter.new("1.27.1")
# Save a specific page as a PNG file
converter.convert_to_png("input.pdf", "page0.png", page_num: 0, dpi: 150)
# Get the total number of pages
puts converter.page_count("input.pdf")
# Get raw RGB pixel data for a page
pixels = converter.get_image_data("input.pdf", page_num: 0, dpi: 300)
Contributing
- Fork it (https://github.com/jgaskins/mupdf/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Jamie Gaskins - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Apr 4, 2026
- Crystal
>= 1.19.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/jgaskins/mupdf
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 16, 2026
- Synced
- Aug 16, 2026
- Versions
- 1