Create PDF documents in crystal using libhpdf / libharu
MIT License
Shard to create PDF documents with crystal using libharu/libhpdf.
Example renderings of the example files and specs:
.
Add the dependency to your shard.yml
:
dependencies:
hpdf:
github: threez/hpdf.cr
Run shards install
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"
Before usage you have to install the library libharu which depends on libpng and zlib:
Use the examples to write demos. Read about libharu here:
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)