Comparing version 0.0.2 to 0.0.3
@@ -9,4 +9,14 @@ | ||
function convert (source, destination, callback) { | ||
function convert (source, destination, options, callback) { | ||
if (typeof options == 'function') { | ||
// shift the callback back | ||
callback = options; | ||
// default options | ||
options = { }; | ||
} | ||
fs.stat(source, function (err, stats) { | ||
@@ -22,3 +32,3 @@ | ||
// convert the specified file to an image | ||
topdf.convert(source, destination, function (err, success) { | ||
topdf.convert(source, destination, options, function (err, success) { | ||
@@ -25,0 +35,0 @@ // error on failure |
{ | ||
"name": "topdf", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A node.js addon for Oracle's pdf export library.", | ||
@@ -5,0 +5,0 @@ "main": "lib/topdf.js", |
@@ -8,4 +8,13 @@ A node.js addon for Oracle's pdf export library. | ||
topdf.convert('./test/etc/foo.xlsx', './test/etc/foo.pdf', function (err, success) { | ||
// the default settings | ||
var options = { | ||
watermark: './test/etc/test.png', | ||
fontdirectory: '/usr/share/fonts/truetype/msttcorefonts' | ||
}; | ||
// convert a single document, using custom settings | ||
topdf.convert('./test/etc/foo.xlsx', './test/etc/foo.pdf', options, function (err, success) { | ||
if (err || !success) { | ||
@@ -24,2 +33,12 @@ | ||
# Options | ||
1. watermark | ||
> A path to an image file to be used as the watermark image. This defaults to not watermark image if this propery is omitted. | ||
2. fontdirectory | ||
> A path to a directory containing true type fonts to be used. This defaults to `/usr/share/fonts/truetype/msttcorefonts` if this property is omitted. This option is *required*, if the default does not fit your setup. | ||
# Runtime Prerequisites | ||
@@ -26,0 +45,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32233
11
47
52