Grunt Task for executing XML/HTML to [PDF renderer PrinceXML via Node-Prince integration API.
This plugin requires Grunt ~0.4.0
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-princess --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks("grunt-princess");
-
binary
(defaultprince
): corresponds to node-prince API functionPrince#binary()
-
prefix
(default ``): corresponds to node-prince API functionPrince#prefix()
-
license
(default ``): corresponds to node-prince API functionPrince#license()
-
timeout
(default10000
): corresponds to node-prince API functionPrince#timeout()
-
cwd
(default.
): corresponds to node-prince API functionPrince#cwd()
-
option
(default{}
): each key/value entry corresponds to node-prince API functionPrince#option()
Run this task with the grunt princess
command.
Task targets, files and options may be specified according to the Grunt Configuring tasks guide.
Assuming we have the following build environment:
Gruntfile.js
:
// [...]
grunt.initConfig({
"princess": {
options: {
license: "license.dat"
},
"user-manual": {
options: {
option: {
media: "print"
}
},
src: [ "user-manual.html" ],
dest: "user-manual.pdf"
},
"dev-manual": {
options: {
option: {
verbose: true
}
},
src: [ "dev-manual.html" ],
dest: "dev-manual.pdf"
}
}
});
grunt.registerTask("manuals", [ "princess:user-manual", "princess:dev-manual" ]);
// [...]