Skip to content

Commit

Permalink
can download labels
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaamo committed Oct 26, 2022
1 parent 094c860 commit 6c28805
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions front/src/components/label/generator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
<div v-if="template && pdf">
<PvButton @click.prevent="printPdf" label="Print Labels PDF">
</PvButton>
<PvButton
class="ml-2"
@click.prevent="downloadPdf"
label="Print Labels PDF"
>
</PvButton>
<br />
<VuePdfEmbed ref="pdfViewer" :source="pdf" />
</div>
Expand Down Expand Up @@ -150,6 +156,14 @@ export default {
printPdf() {
this.$refs.pdfViewer.print();
},
downloadPdf() {
let link = document.createElement("a");
link.href = this.pdf;
link.download = "labels.pdf";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
},
};
</script>

0 comments on commit 6c28805

Please sign in to comment.