https://github.com/shubhambansal1997/pdf-to-base64
Convert pdf from file or url to base64
https://github.com/shubhambansal1997/pdf-to-base64
base64 code convert loader module node nodejs pdf pdf-src pdf-to-base64 pdf2base64 src webpack
Last synced: 18 days ago
JSON representation
Convert pdf from file or url to base64
- Host: GitHub
- URL: https://github.com/shubhambansal1997/pdf-to-base64
- Owner: ShubhamBansal1997
- License: mit
- Created: 2018-10-27T01:31:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-04T00:26:10.000Z (over 4 years ago)
- Last Synced: 2025-04-19T12:05:09.686Z (about 1 month ago)
- Topics: base64, code, convert, loader, module, node, nodejs, pdf, pdf-src, pdf-to-base64, pdf2base64, src, webpack
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 19
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pdf-to-base64
Generate a base64 from pdf path or url.[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[](https://travis-ci.org/ShubhamBansal1997/pdf-to-base64)
[](https://david-dm.org/ShubhamBansal1997/pdf-to-base64?type=dev)
[](https://www.codacy.com/app/ShubhamBansal1997/pdf-to-base64?utm_source=github.com&utm_medium=referral&utm_content=ShubhamBansal1997/pdf-to-base64&utm_campaign=Badge_Grade)## About
It was all about converting the pdf into base64 string## Getting Started
Install
```bash
npm i -S pdf-to-base64
```
After:
After:
```js
const pdf2base64 = require('pdf-to-base64');
pdf2base64("test/sample.pdf")
.then(
(response) => {
console.log(response); //cGF0aC90by9maWxlLmpwZw==
}
)
.catch(
(error) => {
console.log(error); //Exepection error....
}
)
``````js
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](https://opensource.org/licenses/MIT)[npm-image]: https://img.shields.io/npm/v/pdf-to-base64.svg
[npm-url]: https://npmjs.org/package/pdf-to-base64
[downloads-image]: https://img.shields.io/npm/dm/pdf-to-base64.svg
[downloads-url]: https://npmjs.org/package/pdf-to-base64