Skip to content

ShubhamBansal1997/pdf-to-base64

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pdf-to-base64

Generate a base64 from pdf path or url.

NPM Version NPM Downloads Build Status devDependencies Status Codacy Badge License

About

It was all about converting the pdf into base64 string

Getting Started

Install

npm i -S pdf-to-base64

After: After:

const pdf2base64 = require('pdf-to-base64');
pdf2base64("test/sample.pdf")
    .then(
        (response) => {
            console.log(response); //cGF0aC90by9maWxlLmpwZw==
        }
    )
    .catch(
        (error) => {
            console.log(error); //Exepection error....
        }
    )
const pdf2base64 = require('pdf-to-base64');
pdf2base64("http://www.africau.edu/images/default/sample.pdf")
    .then(
        (response) => {
            console.log(response); //cGF0aC90by9maWxlLmpwZw==
        }
    )
    .catch(
        (error) => {
            console.log(error); //Exepection error....
        }
    )

LICENSE

MIT