Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 5 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-04T00:26:10.000Z (about 4 years ago)
- Last Synced: 2024-10-29T01:22:35.078Z (16 days 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: 18
- Watchers: 2
- 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]
[![Build Status](https://travis-ci.org/ShubhamBansal1997/pdf-to-base64.svg?branch=master)](https://travis-ci.org/ShubhamBansal1997/pdf-to-base64)
[![devDependencies Status](https://david-dm.org/ShubhamBansal1997/pdf-to-base64/dev-status.svg)](https://david-dm.org/ShubhamBansal1997/pdf-to-base64?type=dev)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d66858b831d74e358e6ce381dd27b931)](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