-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathExportToPDF.vue
32 lines (30 loc) · 936 Bytes
/
ExportToPDF.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<template>
<div class="container">
<h1>SurveyJS PDF Export</h1>
<div class="jumbotron">
<p>SurveyJS PDF Export is a client-side extension over the SurveyJS Library that enables users to save surveys as PDF documents.</p>
<p>NOTE: Dynamic elements and characteristics (visibility, validation, navigation buttons) are not supported.</p>
<p>Click the button below to export survey to a PDF document.</p>
<button v-on:click="savePDF">Save as PDF</button>
</div>
</div>
</template>
<script>
import { Model } from "survey-vue";
import { SurveyPDF } from "survey-pdf";
import { json } from "../data/survey_json";
export default {
data() {
const model = new Model(json);
const savePDF = function() {
const surveyPDF = new SurveyPDF(json);
surveyPDF.data = model.data;
surveyPDF.save();
};
return {
survey: model,
savePDF: savePDF
};
}
};
</script>