PDF Generator v0.2.2 PdfGenerator
PdfGenerator
Provides a simple wrapper around wkhtmltopdf and pdftk to generate possibly encrypted PDFs from an HTML source.
System requirements
- wkhtmltopdf
- pdftk (optional, for encrypted PDFs)
- goon (optional, for Porcelain shalle wrapper)
Precompiled wkhtmltopdf binaries can be obtained here: http://wkhtmltopdf.org/downloads.html
pdftk should be available as package on your system via
apt-get install pdftk
on Debian/Ubuntubrew pdftk
on OSX (you’ll need homebrew, of course)- Install the Exe-Installer on Windows found the project’s homepage (link above)
goon is available here: https://github.com/alco/goon/releases
Summary
Functions
Generates a pdf file from given html string. Returns a string containing a temporary file path for that PDF
Callback implementation for c::application.start/2
Functions
Generates a pdf file from given html string. Returns a string containing a temporary file path for that PDF.
options:
- page_size: output page size, defaults to “A4”
- open_password: password required to open PDF. Will apply encryption to PDF
- edit_password: password required to edit PDF
- shell_params: list of command-line arguments to wkhtmltopdf see http://wkhtmltopdf.org/usage/wkhtmltopdf.txt for all options
Examples
pdf_path_1 = PdfGenerator.generate “