1.4.0 • Published 3 years ago
@molgenis/vue-pdfium v1.4.0
vue-pdfium
Install
Manual
Node.js 13 or later is required (native ESM).
git@github.com:molgenis/vue-pdfium.git
cd vue-pdfium
yarn
cp .pdfrc.example .pdfrc
node src/service.js
Docker
git@github.com:molgenis/vue-pdfium.git
cd vue-pdfium
docker build . -t vue-pdfium
docker container run -p 3000:3000 vue-pdfium
docker run -it -p 3000:3000 vue-pdfium bash
Usage
POST the component name to render and its state to /vuepdf
:
import axios from 'axios'
// We could have used URL.createObjectURL manually, but
// this library takes care of IE/Safari edge cases as well.
import fileDownload from 'js-file-download'
const res = await axios({
method: 'POST',
url: '/vuepdf',
responseType: 'blob',
data: {
component: 'orders',
state
}
})
fileDownload(res.data, 'mypdf.pdf', 'application/pdf')
Development
# Set `dev` to true, which autoreloads components on every request.
vim .pdfrc
# Fill state.json with the results of JSON.stringify(data).
# This allows you to develop with static state and GET requests.
cp state.json.example state.json
nodemon src/service.js
During development, open /vuepdf-dev
in a Chrom(e/ium) browser and use
the Livereload extension
to watch the rendered PDF in the browser while you update your component & styling.
1.4.0
3 years ago
1.3.5
4 years ago
1.3.4
4 years ago
1.3.3
4 years ago
1.3.2
4 years ago
1.3.1
4 years ago
1.3.0
4 years ago
1.2.2
4 years ago
1.2.0
4 years ago
1.2.1
4 years ago
1.0.0
4 years ago
1.1.3
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.5
4 years ago
1.0.2
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.1
4 years ago