hpdf.cr v0.9.7
hpdf
Shard to create PDF documents with crystal using libharu/libhpdf.
Example renderings of the example files and specs:
Installation
-
Add the dependency to your
shard.yml
:dependencies: hpdf: github: threez/hpdf.cr
-
Run
shards install
Usage
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
Before usage you have to install the library libharu which depends on libpng and zlib:
System | Command |
---|---|
Alpine | apk add libharu |
Debian/Ubuntu | sudo apt install libhpdf-dev |
Centos | sudo yum install libharu-devel |
Fedora/Redhat | sudo dnf install libharu-devel |
FreeBSD | pkg install libharu |
OpenBSD | pkg_add libharu |
macOS | brew install libharu |
Development
Use the examples to write demos. Read about libharu here:
Contributing
- Fork it (https://github.com/threez/hpdf.cr/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
- Vincent Landgraf - creator and maintainer
Repository
hpdf.cr
Owner
Statistic
- 15
- 0
- 0
- 0
- 1
- 6 months ago
- July 26, 2022
License
MIT License
Links
Synced at
Thu, 07 Nov 2024 13:12:49 GMT
Languages