Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paralect/pdf-service
A docker based service for pdf and image generation
https://github.com/paralect/pdf-service
docker node-module paralect-stack pdf pdf-generation pdf-service webpack
Last synced: 2 months ago
JSON representation
A docker based service for pdf and image generation
- Host: GitHub
- URL: https://github.com/paralect/pdf-service
- Owner: paralect
- License: mit
- Created: 2018-01-14T13:42:58.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-29T06:22:10.000Z (9 months ago)
- Last Synced: 2024-08-08T21:10:22.840Z (6 months ago)
- Topics: docker, node-module, paralect-stack, pdf, pdf-generation, pdf-service, webpack
- Language: JavaScript
- Size: 5.36 MB
- Stars: 18
- Watchers: 11
- Forks: 4
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
:scroll: PDF Service
[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
===========
![Stack](https://raw.githubusercontent.com/paralect/stack/master/stack-component-template/stack.png)###### [CLIENT API](client/README.md) | [SERVER API](server/README.md) | [CONTRIBUTING](CONTRIBUTING.md)
> Pdf service can be used for pdf generating (reports, receipts and etc.) from the html sources.Features
========
Here are a few examples to get you started:* :rocket: Generate PDF(screenshots) from the html as a string / file.
* :package: Build your assets without headache.Installation
========You should start pdf server first. It is easy to mange if you have docker:
```
docker pull paralect/pdf-service
docker run -d -p 3000:3000 paralect/pdf-service
```After that install client library:
```
npm i @paralect/pdf-service-client
```Quick example
=============
In your js file write these lines:```
const PdfService = require('@paralect/pdf-service-client'); // require client pdf service library
const fs = require('fs'); // fs to write file// pdf service init
const pdfService = new PdfService({
serverUrl: 'http://localhost:3000',
mode: 'development',
});// generate pdf by html string
pdfService.generatePdfByContent('Hello, {{name}}!
', {
pdfOptions: {
format: 'Letter',
},
templateSystem: {
params: {
name: 'Your name',
},
},
}).then((pdfStream) => {
const writeStream = fs.createWriteStream('./hello.pdf');pdfStream.pipe(writeStream);
writeStream.on('finish', () => {
console.log('Hello pdf was created!');
});
});
```Execution of this code should generate pdf file with 'Hello, Your name' string.
Full API Reference
=================
Explore the API documentation([client side](client/README.md) and [server side](server/README.md)) and [examples](client/samples) to learn more.Change Log
=================This project adheres to [Semantic Versioning](http://semver.org/).
Every release is documented on the Github [Releases](https://github.com/paralect/pdf-service/releases) page.License
=================Ship is released under the [MIT License](LICENSE).
Contributing
=================Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
Contributors
=================Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
| [
KuhArt](https://github.com/KuhArt)
[π»](https://github.com/paralect/pdf-service/commits?author=KuhArt "Code") [π](https://github.com/paralect/pdf-service/commits?author=KuhArt "Documentation") [π](https://github.com/paralect/pdf-service/issues?q=author%3AKuhArt "Bug reports") | [
Uladzimir Mitskevich](https://github.com/umitskevich)
[π€](#ideas-umitskevich "Ideas, Planning, & Feedback") [π](https://github.com/paralect/pdf-service/issues?q=author%3Aumitskevich "Bug reports") | [
NesterenkoNikita](https://github.com/NesterenkoNikita)
[π€](#ideas-NesterenkoNikita "Ideas, Planning, & Feedback") [π](https://github.com/paralect/pdf-service/issues?q=author%3ANesterenkoNikita "Bug reports") | [
Andrew Orsich](http://paralect.com)
[π€](#ideas-anorsich "Ideas, Planning, & Feedback") [π](https://github.com/paralect/pdf-service/issues?q=author%3Aanorsich "Bug reports") [π¨](#design-anorsich "Design") | [
Evgeny Zhivitsa](https://github.com/ezhivitsa)
[π»](https://github.com/paralect/pdf-service/commits?author=ezhivitsa "Code") [π¨](#design-ezhivitsa "Design") | [
ΠΠ΅Π½Ρ Π€ΠΈΠ»ΠΈΠΏΠΏΠΎΠ²ΠΈΡ](https://github.com/filipochka97)
[π](https://github.com/paralect/pdf-service/issues?q=author%3Afilipochka97 "Bug reports") |
| :---: | :---: | :---: | :---: | :---: | :---: |This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!