├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── custom.md
│ └── feature_request.md
├── .gitignore
├── README.md
├── babel.config.js
├── package-lock.json
├── package.json
├── public
├── _redirects
├── favicon.ico
└── index.html
├── src
├── App.vue
├── assets
│ ├── axe.jpg
│ ├── logo.png
│ └── style
│ │ └── app.scss
├── components
│ ├── ControlsContainer.vue
│ ├── PdfContent.vue
│ └── VueHtml2pdf.vue
├── main.js
└── store
│ └── index.js
└── vue.config.js
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | This is a Demo Repo. of the package.
11 | Please create an issue here at the package's Repo. https://github.com/kempsteven/vue-html2pdf/issues, Thanks!
12 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/custom.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Custom issue template
3 | about: Describe this issue template's purpose here.
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | This is a Demo Repo. of the package.
11 | Please create an issue here at the package's Repo. https://github.com/kempsteven/vue-html2pdf/issues, Thanks!
12 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | This is a Demo Repo. of the package.
11 | Please create an issue here at the package's Repo. https://github.com/kempsteven/vue-html2pdf/issues, Thanks!
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw?
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Note: If you are creating an Issue, Please create at the package's repository. This is the Packages Demo repository, Thanks!
2 | https://github.com/kempsteven/vue-html2pdf/issues
3 |
4 | # test-npm
5 |
6 | ## Project setup
7 | ```
8 | npm install
9 | ```
10 |
11 | ### Compiles and hot-reloads for development
12 | ```
13 | npm run serve
14 | ```
15 |
16 | ### Compiles and minifies for production
17 | ```
18 | npm run build
19 | ```
20 |
21 | ### Run your tests
22 | ```
23 | npm run test
24 | ```
25 |
26 | ### Lints and fixes files
27 | ```
28 | npm run lint
29 | ```
30 |
31 | ### Customize configuration
32 | See [Configuration Reference](https://cli.vuejs.org/config/).
33 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue-html2pdf-demo",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build"
8 | },
9 | "dependencies": {
10 | "apexcharts": "^3.10.1",
11 | "core-js": "^3.4.7",
12 | "html2pdf.js": "^0.9.2",
13 | "vue": "^2.6.10",
14 | "vue-apexcharts": "^1.5.1",
15 | "vue-html2pdf": "^1.8.0",
16 | "vue-html2pdf-test": "^1.8.0",
17 | "vuex": "^3.1.2",
18 | "vuex-map-fields": "^1.3.6"
19 | },
20 | "devDependencies": {
21 | "@vue/cli-plugin-babel": "^4.1.0",
22 | "@vue/cli-service": "^4.1.0",
23 | "node-sass": "^4.12.0",
24 | "sass-loader": "^8.0.0",
25 | "vue-template-compiler": "^2.6.10"
26 | },
27 | "browserslist": [
28 | "> 1%",
29 | "last 2 versions"
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/public/_redirects:
--------------------------------------------------------------------------------
1 | # Netlify settings for single-page application
2 | /* /index.html 200
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kempsteven/vue-html2pdf-demo/612cbb2d45baf0702e2a787962a20ca48e377605/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Vue HTML2PDF
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
195 |
196 |
248 |
--------------------------------------------------------------------------------
/src/assets/axe.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kempsteven/vue-html2pdf-demo/612cbb2d45baf0702e2a787962a20ca48e377605/src/assets/axe.jpg
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kempsteven/vue-html2pdf-demo/612cbb2d45baf0702e2a787962a20ca48e377605/src/assets/logo.png
--------------------------------------------------------------------------------
/src/assets/style/app.scss:
--------------------------------------------------------------------------------
1 | @import url('https://fonts.googleapis.com/css?family=Roboto:400,700');
2 | @import url('https://fonts.googleapis.com/css?family=Lato:400,700');
3 | @import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700');
4 |
5 |
6 | input, textarea {
7 | &:required {
8 | box-shadow: none;
9 | }
10 | &:invalid {
11 | box-shadow: none;
12 | }
13 |
14 | &:-webkit-autofill {
15 | -webkit-box-shadow: 0 0 0 30px white inset !important;
16 | }
17 |
18 | &::placeholder {
19 | color: #bbbbbb;
20 | }
21 |
22 | &:focus {
23 | outline-style: none;
24 | }
25 | }
26 |
27 | * {
28 | margin: 0;
29 | padding: 0;
30 | box-sizing: border-box;
31 | font-family: 'Lato', sans-serif;
32 | color: #4A4C50;
33 | word-break: break-word;
34 | word-wrap: break-word;
35 | text-align: left;
36 |
37 | &::-webkit-scrollbar-track {
38 | background: transparent;
39 | }
40 |
41 | &::-webkit-scrollbar {
42 | width: 5px;
43 | height: 5px;
44 | background-color: #979CAC;
45 | background: transparent;
46 | }
47 |
48 | &::-webkit-scrollbar-thumb {
49 | border-radius: 10px;
50 | background-color: #979CAC;
51 | }
52 | }
53 |
54 | @keyframes animate-fade-in-top{
55 | from{
56 | transform: translateY(-50px);
57 | opacity: 0;
58 | }
59 | to{
60 | transform: translateY(0px);
61 | opacity: 1;
62 | }
63 | }
64 |
65 | @mixin fadeintop($duration, $delay){
66 | animation-name: animate-fade-in-top;
67 | animation-duration: $duration;
68 | animation-delay: $delay;
69 | animation-fill-mode: forwards;
70 | animation-timing-function: ease-in-out;
71 | }
--------------------------------------------------------------------------------
/src/components/ControlsContainer.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
13 |
41 |
42 |
43 |
44 |
45 | Type:
46 |
47 |
48 |
49 | {{ control.type }}
50 |
51 |
52 |
53 |
54 |
55 | Options:
56 |
57 |
58 |
59 | {{ control.options }}
60 |
61 |
62 |
63 |
64 |
65 | Note:
66 | When enabling this prop, the prop
paginate-elements-by-height will not be used.
67 | Instead the pagination process will rely on the elements with a class "html2pdf__page-break"
68 | to know where to page break.
69 |
70 |
71 |
72 |
73 | Note:
There is a prop called html-to-pdf-options, if you set a value to
74 | this prop, the props below will be overridden:
75 | filename
76 | pdf-quality
77 | pdf-format
78 | pdf-orientation.
79 | Any value inputed to those props above will have no effect.
80 |
81 |
82 |
83 |
90 |
91 |
92 |
98 |
99 |
100 |
101 | {{ progress === 100 ? 'PDF Generated' : 'Generating PDF' }}
102 |
103 |
104 |
105 | {{ `${ progress } %` }}
106 |
107 |
108 |
109 |
110 |
111 |
112 |
246 |
247 |
--------------------------------------------------------------------------------
/src/components/PdfContent.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
13 |
14 | Mogul Khan Touch This
15 |
16 |
17 | Game:
18 | Game No. 3
19 |
20 |
21 |
22 | Date and Time
23 | November 11, 2019 1:00 PM - 2:23 PM
24 |
25 |
26 |
27 | Game Replay Link:
28 |
29 | https://www.youtube.com/watch?v=dQw4w9WgXcQ
30 |
31 |
32 |
33 |
34 |
35 | November 11, 2019 1:00 PM - 2:23 PM
36 |
37 |
38 |
39 |
40 |
41 |
42 |
172 |
173 |
--------------------------------------------------------------------------------
/src/components/VueHtml2pdf.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 |
21 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
290 |
291 |
362 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import VueApexCharts from 'vue-apexcharts'
4 | import Vuex from 'vuex'
5 | import store from './store'
6 |
7 | Vue.use(Vuex)
8 |
9 | Vue.use(VueApexCharts)
10 |
11 | Vue.component('apexchart', VueApexCharts)
12 |
13 | Vue.config.productionTip = false
14 |
15 | new Vue({
16 | store,
17 | render: h => h(App),
18 | }).$mount('#app')
19 |
--------------------------------------------------------------------------------
/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Vuex from 'vuex';
3 | import { getField, updateField } from 'vuex-map-fields';
4 |
5 | Vue.use(Vuex);
6 |
7 | export default new Vuex.Store({
8 | state: {
9 | controlValue: {
10 | showLayout: false,
11 | floatLayout: true,
12 | enableDownload: true,
13 | previewModal: true,
14 | paginateElementsByHeight: 1100,
15 | manualPagination: false,
16 | filename: 'Hee Hee',
17 | pdfQuality: 2,
18 | pdfFormat: 'a4',
19 | pdfOrientation: 'portrait',
20 | pdfContentWidth: '800px'
21 | }
22 | },
23 |
24 | mutations: {
25 | updateField
26 | },
27 |
28 | getters: {
29 | getField
30 | },
31 | })
--------------------------------------------------------------------------------
/vue.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | css: {
3 | loaderOptions: {
4 | // pass options to sass-loader
5 | // @/ is an alias to src/
6 | // so this assumes you have a file named `src/variables.sass`
7 | // Note: this option is named as "data" in sass-loader v7
8 | // sass: {
9 | // prependData: `@import "~@/variables.sass"`
10 | // },
11 | // by default the `sass` option will apply to both syntaxes
12 | // because `scss` syntax is also processed by sass-loader underlyingly
13 | // but when configuring the `data` option
14 | // `scss` syntax requires an semicolon at the end of a statement, while `sass` syntax requires none
15 | // in that case, we can target the `scss` syntax separately using the `scss` option
16 | scss: {
17 | prependData: `@import "~@/assets/style/app.scss";`
18 | },
19 | // pass Less.js Options to less-loader
20 | // less:{
21 | // // http://lesscss.org/usage/#less-options-strict-units `Global Variables`
22 | // // `primary` is global variables fields name
23 | // globalVars: {
24 | // primary: '#fff'
25 | // }
26 | // }
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------