hpdf
Version, currently 1.0.012 versions
- 1.0.0latestJun 19, 2026
- 0.9.10not indexedJun 19, 2026
- 0.9.9not indexedJun 19, 2026
- 0.9.8not indexedJun 19, 2026
- 0.9.7not indexedJun 19, 2026
- 0.9.6not indexedJun 19, 2026
- 0.9.5not indexedJun 19, 2026
- 0.9.4not indexedJun 19, 2026
- 0.9.3not indexedJun 19, 2026
- 0.9.2not indexedJun 19, 2026
- 0.9.1not indexedJun 19, 2026
- 0.9.0not indexedJun 19, 2026
github.com/threez/hpdf.cr
Create PDF documents in crystal using libhpdf / libharu
19 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
hpdf:
github: threez/hpdf.cr
version: ~> 1.0.0Then run:
shards installshard.yml
- Crystal
1.4.1- License
- MIT
- Author
- Vincent Landgraf <vincent@landgrafx.de>
- Targets
example-arcfrom ./examples/arc.crexample-utffrom ./examples/utf.crexample-fontfrom ./examples/font.crexample-linefrom ./examples/line.crexample-textfrom ./examples/text.crexample-hellofrom ./examples/hello.crexample-jpfontfrom ./examples/jpfont.crexample-shapesfrom ./examples/shapes.crexample-accentedfrom ./examples/accented.crexample-colortextfrom ./examples/colortext.crexample-encodingsfrom ./examples/encodings.crexample-link-annotationfrom ./examples/link_annotation.crexample-text-annotationfrom ./examples/text_annotation.cr
Dependencies
Development Dependencies
- ameba~> 1.6.0github: crystal-ameba/amebadev
README
# hpdf [](https://github.com/threez/hpdf.cr/actions/workflows/ci.yml) [](https://threez.github.io/hpdf.cr/)
Shard to create PDF documents with crystal using [libharu/libhpdf](https://github.com/libharu/libharu/).
Example renderings of the example files and specs:
[](pdfs).
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
hpdf:
github: threez/hpdf.cr
```
2. Run `shards install`
## Usage
```crystal
require "hpdf"
pdf = Hpdf::Doc.build do
page do
draw_rectangle 50, 50, width - 100, height - 110
text Hpdf::Base14::Helvetica, 70 do
text_out :center, :center, "Hello World"
end
end
end
pdf.save_to_file "hello.pdf"
```
## C library dependencies
Requires **libharu ≥ 2.4.6**, which depends on **libpng** and **zlib**.
- **macOS** — `brew install libharu` (ships ≥ 2.4.6)
- **Alpine** — `apk add libharu` (check version; build from submodule if < 2.4.6)
- **Arch Linux** — `pacman -S libharu`
- **FreeBSD** — `pkg install libharu`
- **OpenBSD** — `pkg_add libharu`
- **Debian/Ubuntu** — `apt` ships libhpdf 2.3 (too old). Build from the bundled submodule instead:
```bash
git clone https://github.com/threez/hpdf.cr
cd hpdf.cr
make libharu # initialises submodule and builds a static lib; no system install needed
```
The shard's `@[Link]` detects and links the built static library automatically.
## Development
Use the examples to write demos. Read about *libharu* here:
* http://libharu.sourceforge.net/index.html
* https://github.com/libharu/libharu/wiki
## Contributing
1. Fork it (https://github.com/threez/hpdf.cr/fork)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [Vincent Landgraf](https://github.com/threez) - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.0.0- Tagged
- Jun 19, 2026
- Commit
98c60bb9f6f7- Crystal
1.4.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/threez/hpdf.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 12