![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
grunt-wkhtmltopdf
Advanced tools
A simple Grunt multitask that uses wkhtmltopdf to convert HTML files to PDF.
Convertion to PDF takes care of @media print
CSS rules and preserves links to remote web pages.
Download and install wkhtmltopdf from the project page.
Make sure wkhtmltopdf
is accessible from your PATH
(Try wkhtmltopdf -V
in your Terminal).
I'm on Mac OS X, so I created the following symlink to my /usr/local/bin/
folder:
ln -s /usr/local/bin/wkhtmltopdf.app/Contents/MacOS/wkhtmltopdf /usr/local/bin/wkhtmltopdf
You can also install it via homebrew: $ brew install wkhtmltopdf
.
Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-wkhtmltopdf
Then add this line to your project's grunt.js
gruntfile:
grunt.loadNpmTasks('grunt-wkhtmltopdf');
Simply add task definition in your gruntfile. See the folllowing example:
//...
wkhtmltopdf: {
dev: {
src: 'path/to/some/html/file/*.html',
dest: 'pdf/output/'
},
prod: {
src: 'path/to/some/html/file/*.html',
dest: 'pdf/output/'
}
},
//...
Run grunt wkhtmltopdf
to execute all the targets or grunt wkhtmltopdf:targetname
to execute a specific target. Every html
file defined by the src
parameter will be turned into a PDF and saved to dest
folder.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
Copyright (c) 2012 Olivier Audard
Licensed under the MIT license.
FAQs
Grunt Task that uses wkhtmltopdf to convert HTML files to PDF
The npm package grunt-wkhtmltopdf receives a total of 4 weekly downloads. As such, grunt-wkhtmltopdf popularity was classified as not popular.
We found that grunt-wkhtmltopdf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.