0.4.2 • Published 6 years ago

rf-api-url2pdf v0.4.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Deprecated! Please use url2pdf3 which uses up to date technology and is mantained!

rf-api-url2pdf

Create a pdf from a website via given url, return the pdf file content as buffer. Take snapshots of multiple sites and merge the pdfs, when an array of urls is passed.

Getting Started

npm install rf-api-url2pdf

Init the service

var services: {
   getPdf: require('rf-api-url2pdf').start({
      saveDir: '/pdfTmp' // path where the pdfs are stored
   }).getPdf
}

Use the service

// simple example
service.getPdf( 'http://www.ebay.de', function(err, pdfBuffer){
   console.log(pdfBuffer);
})

// take a snapshot of multiple sites and join the pdfs
var urls = ['http://www.ebay.de', 'http://www.google.com'];

service.getPdf(urls, function(err, pdfBuffer){
   console.log(pdfBuffer);
})

// with rf-api
API.post('/pdf', function(req, res){
   service.getPdf('http://www.test.com', res.send);
})


// options
var options = {
   saveDir: '/exportTemp'  // optional alternativ path to create pdfs
   loadTimeout: 3000,      // timeout in [ms] to wait till site should be loaded
   onlyFilePath: false,    // only return path to pdf files, do not read them in
   buffer: false,          // false: return file content; true: return a buffer from binary file content
   debug: true             // optional show phantom debug messages
};
service.getPdf(urls, callback, options)

Development

Install the dev tools with

npm install

Then you can runs some test cases and eslint with:

npm test

Legal Issues

  • License: MIT
  • Author: Rapidfacture GmbH
0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.3

6 years ago

0.1.0

6 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago