{"id":15731776,"url":"https://github.com/sango-tech/vue3-simple-html2pdf","last_synced_at":"2025-05-05T20:12:11.441Z","repository":{"id":46725344,"uuid":"361655393","full_name":"sango-tech/vue3-simple-html2pdf","owner":"sango-tech","description":"Export/Download Vue3 using html2pdf.js. Easy to custom any pdf style because it is exported from real HTML.","archived":false,"fork":false,"pushed_at":"2023-04-04T12:54:54.000Z","size":158,"stargazers_count":24,"open_issues_count":6,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-05T20:11:59.270Z","etag":null,"topics":["html2pdf","vue3"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sango-tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-26T07:22:33.000Z","updated_at":"2025-04-25T23:38:03.000Z","dependencies_parsed_at":"2025-01-31T22:06:55.552Z","dependency_job_id":"65bea30e-978a-4b24-b556-54b2b8d23f3f","html_url":"https://github.com/sango-tech/vue3-simple-html2pdf","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sango-tech%2Fvue3-simple-html2pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sango-tech%2Fvue3-simple-html2pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sango-tech%2Fvue3-simple-html2pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sango-tech%2Fvue3-simple-html2pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sango-tech","download_url":"https://codeload.github.com/sango-tech/vue3-simple-html2pdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252569646,"owners_count":21769517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html2pdf","vue3"],"created_at":"2024-10-04T00:05:27.118Z","updated_at":"2025-05-05T20:12:11.390Z","avatar_url":"https://github.com/sango-tech.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue3-simple-html2pdf\n\n- Export and auto download PDF using vue3 and html2pdf.js.\n- Easy to custom any PDF style because it will be export from real html.\n- Can use custom css style for pdf page using vue style.\n\n# Example sanbox code\n\nhttps://codesandbox.io/s/vue3-simple-html2pdf-jxy2uz\n\n# Install\n\n```\nnpm install --save vue3-simple-html2pdf\n```\n\nor yarn\n\n```\nyarn add vue3-simple-html2pdf\n```\n\n# Register component\n```\nimport Vue3SimpleHtml2pdf from \"vue3-simple-html2pdf\";\nVue.use(Vue3SimpleHtml2pdf);\n```\n\n# Use component\n\n```\n\u003cvue3-simple-html2pdf\n  ref=\"vue3SimpleHtml2pdf\"\n  :options=\"pdfOptions\"\n  :filename=\"exportFilename\"\n\u003e\n  \u003ch2\u003eHTML Table\u003c/h2\u003e\n  \u003ctable\u003e\n    \u003ctr\u003e\n      \u003cth\u003eCompany\u003c/th\u003e\n      \u003cth\u003eContact\u003c/th\u003e\n      \u003cth\u003eCountry\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eAlfreds Futterkiste\u003c/td\u003e\n      \u003ctd\u003eMaria Anders\u003c/td\u003e\n      \u003ctd\u003eGermany\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eCentro comercial Moctezuma\u003c/td\u003e\n      \u003ctd\u003eFrancisco Chang\u003c/td\u003e\n      \u003ctd\u003eMexico\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eErnst Handel\u003c/td\u003e\n      \u003ctd\u003eRoland Mendel\u003c/td\u003e\n      \u003ctd\u003eAustria\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eIsland Trading\u003c/td\u003e\n      \u003ctd\u003eHelen Bennett\u003c/td\u003e\n      \u003ctd\u003eUK\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eLaughing Bacchus Winecellars\u003c/td\u003e\n      \u003ctd\u003eYoshi Tannamuri\u003c/td\u003e\n      \u003ctd\u003eCanada\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eMagazzini Alimentari Riuniti\u003c/td\u003e\n      \u003ctd\u003eGiovanni Rovelli\u003c/td\u003e\n      \u003ctd\u003eItaly\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/table\u003e\n\n  \u003cimg src=\"base64 image or url\"\u003e\n\n  \u003c!-- You can loop to display page number as you want --\u003e\n  \u003cdiv class=\"html2pdf__page-number\"\u003e1\u003c/div\u003e\n\n  \u003c!-- Break page pdf --\u003e\n  \u003cdiv class=\"html2pdf__page-break\"\u003e\u003c/div\u003e\n\n\u003c/vue3-simple-html2pdf\u003e\n\n...\n// Props\npdfOptions = {\n  margin: 15,\n  image: {\n    type: 'jpeg',\n    quality: 1,\n  },\n  html2canvas: { scale: 3 },\n  jsPDF: {\n    unit: 'mm',\n    format: 'a4',\n    orientation: 'p',\n  },\n},\nexportFilename: 'my-custom-file.pdf',\n\n...\n\n\u003cstyle scoped\u003e\ntable {\n  font-size: 14px;\n  text-align: center;\n  border: 1px solid #ccc;\n  border-collapse: collapse;\n  th {\n    background: #ddd;\n    font-weight: bold;\n  }\n  td,\n  th {\n    padding: 8px;\n    border: 1px solid #ccc;\n  }\n}\n... Any other styles here\n\n\u003c/style\u003e\n```\n\nCall start download pdf\n\n```\nthis.$refs.vue3SimpleHtml2pdf.download()\n```\n\n\nTo break page, use `html2pdf__page-break`\n\n```\n\u003cdiv class=\"html2pdf__page-break\"\u003e\u003c/div\u003e\n```\n\nTo add page number, use `html2pdf__page-number`\n\n```\n\u003cdiv class=\"html2pdf__page-number\"\u003e{{ pageNumber }}\u003c/div\u003e\n```\n\n# Sample result\n\n![alt text](/docs/sample.jpg)\n\n# License\n\nThe MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsango-tech%2Fvue3-simple-html2pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsango-tech%2Fvue3-simple-html2pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsango-tech%2Fvue3-simple-html2pdf/lists"}