{"id":17473790,"url":"https://github.com/hrynko/vue-pdf-embed","last_synced_at":"2026-03-06T08:12:38.940Z","repository":{"id":37445771,"uuid":"370417891","full_name":"hrynko/vue-pdf-embed","owner":"hrynko","description":"PDF embed component for Vue 2 and Vue 3","archived":false,"fork":false,"pushed_at":"2026-03-03T06:54:43.000Z","size":403,"stargazers_count":1001,"open_issues_count":18,"forks_count":129,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-03-03T10:28:59.363Z","etag":null,"topics":["pdf","vue"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/vue-pdf-embed","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/hrynko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-05-24T16:30:58.000Z","updated_at":"2026-02-24T07:41:56.000Z","dependencies_parsed_at":"2024-01-02T23:30:20.590Z","dependency_job_id":"997cda8b-58e2-4dd1-bf61-e67a8946ad5f","html_url":"https://github.com/hrynko/vue-pdf-embed","commit_stats":{"total_commits":201,"total_committers":25,"mean_commits":8.04,"dds":"0.15920398009950254","last_synced_commit":"15a6ad64fc67727a44711ab5bcf8b0fae2247f88"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/hrynko/vue-pdf-embed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrynko%2Fvue-pdf-embed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrynko%2Fvue-pdf-embed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrynko%2Fvue-pdf-embed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrynko%2Fvue-pdf-embed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrynko","download_url":"https://codeload.github.com/hrynko/vue-pdf-embed/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrynko%2Fvue-pdf-embed/sbom","scorecard":{"id":470613,"data":{"date":"2025-08-11","repo":{"name":"github.com/hrynko/vue-pdf-embed","commit":"3cb6f4e46f11b1192c5376003501d63266054eca"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"name":"Code-Review","score":2,"reason":"Found 7/30 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":9,"reason":"5 commit(s) and 6 issue activity found in the last 90 days -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/publish-to-npm.yml:9","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-to-npm.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/hrynko/vue-pdf-embed/publish-to-npm.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-to-npm.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/hrynko/vue-pdf-embed/publish-to-npm.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-x574-m823-4x7w","Warn: Project is vulnerable to: GHSA-4r4m-qw57-chr8","Warn: Project is vulnerable to: GHSA-xcj6-pq6g-qj4x","Warn: Project is vulnerable to: GHSA-356w-63v5-8wf4","Warn: Project is vulnerable to: GHSA-859w-5945-r5v3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T13:49:16.746Z","repository_id":37445771,"created_at":"2025-08-19T13:49:16.747Z","updated_at":"2025-08-19T13:49:16.747Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30069242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T01:03:42.280Z","status":"online","status_checked_at":"2026-03-04T02:00:07.464Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["pdf","vue"],"created_at":"2024-10-18T18:07:10.259Z","updated_at":"2026-03-06T08:12:38.931Z","avatar_url":"https://github.com/hrynko.png","language":"Vue","funding_links":[],"categories":["Vue","UI Components [🔝](#readme)","Components \u0026 Libraries"],"sub_categories":["UI Components"],"readme":"# 📄 vue-pdf-embed\n\nPDF embed component for Vue 3 (see [Compatibility](#compatibility) for Vue 2 support)\n\n[![Awesome List](https://raw.githubusercontent.com/sindresorhus/awesome/main/media/mentioned-badge.svg)](https://github.com/vuejs/awesome-vue)\n[![npm Version](https://img.shields.io/npm/v/vue-pdf-embed?style=flat)](https://npmjs.com/package/vue-pdf-embed)\n[![npm Downloads](https://img.shields.io/npm/dm/vue-pdf-embed?style=flat)](https://npmjs.com/package/vue-pdf-embed)\n[![GitHub Stars](https://img.shields.io/github/stars/hrynko/vue-pdf-embed?style=flat)](https://github.com/hrynko/vue-pdf-embed)\n[![License](https://img.shields.io/npm/l/vue-pdf-embed?style=flat)](https://github.com/hrynko/vue-pdf-embed/blob/main/LICENSE)\n\n## Features\n\n- Controlled rendering of PDF documents in Vue apps\n- Handling password-protected documents\n- Includes text layer (searchable and selectable documents)\n- Includes annotation layer (annotations and links)\n- No peer dependencies or additional configuration required\n- Can be used directly in the browser (see [Examples](#examples))\n\n## Compatibility\n\nThis package is only compatible with Vue 3. For Vue 2 support, install `vue-pdf-embed@1` and refer to the [v1 docs](https://github.com/hrynko/vue-pdf-embed/tree/v1).\n\n## Installation\n\nDepending on the environment, the package can be installed in one of the following ways:\n\n```shell\nnpm install vue-pdf-embed\n```\n\n```shell\nyarn add vue-pdf-embed\n```\n\n```html\n\u003cscript src=\"https://unpkg.com/vue-pdf-embed\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n```vue\n\u003cscript setup\u003e\nimport VuePdfEmbed from 'vue-pdf-embed'\n\n// Optional styles\nimport 'vue-pdf-embed/dist/styles/annotationLayer.css'\nimport 'vue-pdf-embed/dist/styles/textLayer.css'\n\n// Either URL, Base64, binary, or document proxy\nconst pdfSource = '\u003cPDF_URL\u003e'\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cVuePdfEmbed annotation-layer text-layer :source=\"pdfSource\" /\u003e\n\u003c/template\u003e\n```\n\n### Props\n\n| Name               | Type                                           | Accepted values                                         | Description                                                                               |\n| ------------------ | ---------------------------------------------- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------- |\n| annotationLayer    | `boolean`                                      |                                                         | whether the annotation layer should be enabled                                            |\n| height             | `number`                                       | natural numbers                                         | desired page height in pixels (ignored if the width property is specified)                |\n| imageResourcesPath | `string`                                       | URL or path with trailing slash                         | path for icons used in the annotation layer                                               |\n| linkService        | `PDFLinkService`                               |                                                         | document navigation service (replaces the default one that emits `internal-link-clicked`) |\n| page               | `number` \u003cbr\u003e `number[]`                       | `1` to the last page number                             | page number(s) to display (displaying all pages if not specified)                         |\n| rotation           | `number`                                       | `0`, `90`, `180`, `270` (multiples of `90`)             | desired page rotation angle in degrees                                                    |\n| scale              | `number`                                       | rational numbers                                        | desired page viewport scale                                                               |\n| source             | `string` \u003cbr\u003e `object` \u003cbr\u003e `PDFDocumentProxy` | document URL or Base64 or typed array or document proxy | source of the document to display                                                         |\n| textLayer          | `boolean`                                      |                                                         | whether the text layer should be enabled                                                  |\n| width              | `number`                                       | natural numbers                                         | desired page width in pixels                                                              |\n\n### Events\n\n| Name                  | Value                                                                   | Description                                    |\n| --------------------- | ----------------------------------------------------------------------- | ---------------------------------------------- |\n| internal-link-clicked | destination page number                                                 | an internal link was clicked                   |\n| loaded                | PDF document proxy                                                      | finished loading the document                  |\n| loading-failed        | error object                                                            | failed to load the document                    |\n| password-requested    | object with `callback` function and `isWrongPassword` flag              | a password is required to display the document |\n| progress              | object with number of `loaded` pages along with `total` number of pages | tracks the document's loading progress         |\n| rendered              | –                                                                       | finished rendering the document                |\n| rendering-failed      | error object                                                            | failed to render the document                  |\n\n### Slots\n\n| Name        | Props                | Description                          |\n| ----------- | -------------------- | ------------------------------------ |\n| after-page  | `page` (page number) | content to be added after each page  |\n| before-page | `page` (page number) | content to be added before each page |\n\n### Public Methods\n\n| Name     | Arguments                                                                    | Description                                  |\n| -------- | ---------------------------------------------------------------------------- | -------------------------------------------- |\n| download | filename (`string`)                                                          | download the document                        |\n| print    | print resolution (`number`), filename (`string`), all pages flag (`boolean`) | print the document via the browser interface |\n\n**Note:** Public methods can be accessed through a [template ref](https://vuejs.org/guide/essentials/template-refs.html).\n\n## Common Issues and Caveats\n\n### Server-Side Rendering\n\nThis is a client-side library, so it is important to keep this in mind when working with SSR (server-side rendering) frameworks such as Nuxt. Depending on the framework used, you may need to properly configure the library import or use a wrapper.\n\n### Web Worker Loading\n\nBy default, the PDF.js web worker is bundled as a blob URL. This works out of the box, but it may be blocked by certain CSP (content security policy) configurations. In such cases, use the essential build and configure the worker manually:\n\n```js\nimport VuePdfEmbed, {\n  GlobalWorkerOptions,\n} from 'vue-pdf-embed/dist/index.essential.mjs'\n\n// Option 1: use a bundler URL import\nimport PdfWorker from 'pdfjs-dist/build/pdf.worker.min.mjs?url'\nGlobalWorkerOptions.workerSrc = PdfWorker\n\n// Option 2: serve the worker from your public directory,\n// copied from pdfjs-dist/build/pdf.worker.min.mjs\nGlobalWorkerOptions.workerSrc = '/pdf.worker.min.mjs'\n```\n\n### Document Loading\n\nTypically, document loading is internally handled within the component. However, for optimization purposes, the document can be loaded with the `useVuePdfEmbed` composable and then passed to the component via the `source` prop (e.g., when sharing the source between multiple instances of the component).\n\n```vue\n\u003cscript setup\u003e\nimport VuePdfEmbed, { useVuePdfEmbed } from 'vue-pdf-embed'\n\nconst { doc } = useVuePdfEmbed({ source: '\u003cPDF_URL\u003e' })\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cVuePdfEmbed :source=\"doc\" /\u003e\n\u003c/template\u003e\n```\n\n### Resources\n\nThe path to predefined CMaps should be provided to ensure correct rendering of documents with non-Latin characters and to avoid CMap-related errors:\n\n```vue\n\u003cVuePdfEmbed\n  :source=\"{\n    cMapUrl: 'https://unpkg.com/pdfjs-dist/cmaps/',\n    url: '\u003cPDF_URL\u003e',\n  }\"\n/\u003e\n```\n\nThe image resource path must be specified for annotations to display correctly:\n\n```vue\n\u003cVuePdfEmbed\n  image-resources-path=\"https://unpkg.com/pdfjs-dist/web/images/\"\n  source=\"\u003cPDF_URL\u003e\"\n/\u003e\n```\n\n**Note:** The examples above use a CDN to load resources, however these resources can also be included in the build by installing the `pdfjs-dist` package as a dependency and further configuring the bundler.\n\n## Examples\n\n[Basic Usage Demo (JSFiddle)](https://jsfiddle.net/hrynko/atcn32yp)\n\n[Advanced Usage Demo (JSFiddle)](https://jsfiddle.net/hrynko/273a59qr)\n\n[Lazy Loading Demo (JSFiddle)](https://jsfiddle.net/hrynko/u149my7h)\n\n## License\n\nMIT License. Please see [LICENSE file](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrynko%2Fvue-pdf-embed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrynko%2Fvue-pdf-embed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrynko%2Fvue-pdf-embed/lists"}