Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

topdf

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

topdf - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

test/etc/test.png

14

lib/topdf.js

@@ -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

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc