PlutoBook is a robust HTML rendering library specifically designed for paged media.
PlutoBook offers APIs for both C and C++. Here are basic examples to get you started:
#include <plutobook.hpp>
int main() {
plutobook::Book book(plutobook::PageSize::A4);
book.loadHtml("<b> Hello World </b>");
book.writeToPdf("hello.pdf");
return 0;
}
#include <plutobook.h>
int main() {
plutobook_t* book = plutobook_create(PLUTOBOOK_PAGE_SIZE_A4, PLUTOBOOK_PAGE_MARGINS_NORMAL, PLUTOBOOK_MEDIA_TYPE_PRINT);
plutobook_load_html(book, "<b> Hello World </b>", -1, "", "", "");
plutobook_write_to_pdf(book, "hello.pdf");
plutobook_destroy(book);
return 0;
}
Ensure you have Meson and Ninja installed.
git clone https://github.com/plutoprint/plutobook.git
cd plutobook
meson setup build
ninja -C build
ninja -C build install
PlutoBook relies on several external libraries for functionality. Make sure you have the following installed:
- Required:
- Cairo: https://www.cairographics.org
- Expat: https://libexpat.github.io
- ICU: http://icu-project.org
- FreeType: https://www.freetype.org
- FontConfig: https://www.freedesktop.org/wiki/Software/fontconfig
- HarfBuzz: https://harfbuzz.github.io
- Optional:
- Curl: https://curl.se
- TurboJPEG: https://libjpeg-turbo.org
- WebP: https://developers.google.com/speed/webp
Detailed information on PlutoBook's functionalities can be found in the header files:
- plutobook.h (C API)
- plutobook.hpp (C++ API)
Contributions to PlutoBook are welcome! Feel free to open issues for bug reports, feature requests, or submit pull requests with enhancements.
PlutoBook is licensed under the MIT License, allowing for both personal and commercial use.