lz-pdf-merage is a Vue component that can preview and synthesize PDF. Its main functions include stamping, adding date, adding text, rotating, printing, saving, etc.
npm install lz-pdf-merage
<template>
<pdfView :pdfPath='pdfPath' :pdfHeight="900" ref="pdfView"/>
</template>
<script>
import pdfView from 'lz-pdf-merage'
export default {
components:{
pdfView
},
data() {
return {
pdfPath: ''
}
}
}
</script>
Same browser support as Vue.js 2
The PDF path that needs to be previewed and synthesized supports local path and HTTP
Container width for preview and composite pdf
Container height for preview and composite pdf
Add a stamp picture
pos
:Is the location random or determined when clicked, random is random, click is determined when clickedwidth
: stamp picture widthheight
: stamp picture heighturl
: stamp picture url SupportBase64
this.$refs.pdfView.addSeal({
pos: 'random' // 'click'
width: 200,
height: 200,
url: './seal.png'
})
Add Date
pos
: dittodate
: DatefontSize
: Date font sizeisTransParent
: Is it transparent
this.$refs.pdfView.addDate({
pos: 'click'
date: '2021 09 18',
fontSize: 24,
isTransParent: true
})
Add Text
pos
: dittoisTransParent
: dittofontSize
: dittotext
: text
this.$refs.pdfView.addText({
pos: 'random'
isTransParent: false
fontSize: 24,
text: '样例展示'
})
Delete selected item
this.$refs.pdfView.deleteItem()
Download synthetic pdf
*name
: pdf name
this.$refs.pdfView.downLoadPdf('合成pdf')
MIT