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

@smarterservices/html-to-pdf-to-s3

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smarterservices/html-to-pdf-to-s3

Module that takes a URL and using pdfcrowd pipes the resulting pdf into an s3 bucket

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

html-to-pdf-to-s3

Installation

npm install @smarterservices/html-to-pdf-to-s3 -s

Usage

let pdfClient = require('@smarterservices/html-to-pdf-to-s3');
let pdf = new pdfClient(config); // config defined below
pdf.convertUrl(url,bucket,name,options)
	.then(console.log)
	.catch(console.log)

Configuration

{
	"accessKey":"aws access key. not required",
	"secretKey":"aws secret key not required",
	"region": "aws region. not required defaults to us-east-1",
	"pdfCrowd": {
		"userName": "pdfCrowd username",
		"apiKey": "pdfCrowd api key",
		"hostName": "pdfCrowd hostname. omit for default."
	}
}

Can use AWS keys in env variable as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY

NOTE: AWS will use credentials in this order passed in to config > in environment var > with your system profile

Methods

convertUrl(url,bucket,name)

  • Arguments
    • url: url that will be converted to pdf
    • bucket: name of bucket to insert item
    • name: name of output item(must end in .pdf)
    • options: options object for pdfCrowd. This is optional.
  • Return: * resolve or reject of promise
Example
pdf.convertUrl('http://google.com','testBucket','google.pdf')
	.then(console.log)
	.catch(console.log)

convertHtml(html, bucket, name)

  • Arguments
    • html: raw html that will be converted
    • bucket: name of bucket to insert item
    • name: name of output item(must end in .pdf)
    • options: options object for pdfCrowd. This is optional.
  • Return:
    • resolve or reject of promise
Example
pdf.convertHtml('<strong>Hi</strong>','testBucket','google.pdf')
	.then(console.log)
	.catch(console.log)					

Keywords

FAQs

Package last updated on 26 Jan 2017

Did you know?

Socket

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.

Install

Related posts

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