{"id":23236670,"url":"https://github.com/mysterlune/ember-pdfjs","last_synced_at":"2025-08-19T23:30:43.469Z","repository":{"id":25916574,"uuid":"29357500","full_name":"mysterlune/ember-pdfjs","owner":"mysterlune","description":"An Ember Addon for PDFJS","archived":false,"fork":false,"pushed_at":"2017-05-17T18:30:49.000Z","size":891,"stargazers_count":25,"open_issues_count":5,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-26T08:50:09.082Z","etag":null,"topics":["addon","ember","javascript","pdfjs","scrolling"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ember-pdfjs","language":"JavaScript","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/mysterlune.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-16T16:41:50.000Z","updated_at":"2024-05-30T02:47:40.000Z","dependencies_parsed_at":"2022-08-20T13:41:45.791Z","dependency_job_id":null,"html_url":"https://github.com/mysterlune/ember-pdfjs","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/mysterlune/ember-pdfjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mysterlune%2Fember-pdfjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mysterlune%2Fember-pdfjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mysterlune%2Fember-pdfjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mysterlune%2Fember-pdfjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mysterlune","download_url":"https://codeload.github.com/mysterlune/ember-pdfjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mysterlune%2Fember-pdfjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271239847,"owners_count":24724740,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"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":["addon","ember","javascript","pdfjs","scrolling"],"created_at":"2024-12-19T04:11:58.712Z","updated_at":"2025-08-19T23:30:43.130Z","avatar_url":"https://github.com/mysterlune.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ember PDFJS Addon\n\n[![Latest NPM release](https://img.shields.io/npm/v/ember-pdfjs.svg)](https://www.npmjs.com/package/ember-pdfjs)\n[![Downloads per month](https://img.shields.io/npm/dm/ember-pdfjs.svg)](https://img.shields.io/npm/dm/ember-pdfjs.svg)\n[![Total downloads](https://img.shields.io/npm/dt/ember-pdfjs.svg)](https://img.shields.io/npm/dt/ember-pdfjs.svg)\n[![Dependencies](https://david-dm.org/mysterlune/ember-pdfjs.svg)](https://david-dm.org/mysterlune/ember-pdfjs)\n[![Dev Dependencies](https://img.shields.io/david/dev/mysterlune/ember-pdfjs.svg)](https://david-dm.org/mysterlune/ember-pdfjs?type=dev)\n[![Issues](https://img.shields.io/github/issues/mysterlune/ember-pdfjs.svg)](https://img.shields.io/github/issues/mysterlune/ember-pdfjs.svg)\n[![Issues](https://img.shields.io/github/issues-closed/mysterlune/ember-pdfjs.svg)](https://img.shields.io/github/issues-closed/mysterlune/ember-pdfjs.svg)\n[![Ember Observer Score](http://emberobserver.com/badges/ember-pdfjs.svg)](http://emberobserver.com/addons/ember-pdfjs)\n\nThis addon will provide some useful components for viewing and interacting with PDF documents to your `ember-cli` project. This addon unites the Ember framework ecosystem and the [PDFJS](https://mozilla.github.io/pdf.js/) open source project by Mozilla.\n\n## Installation\n\nWithin your `ember-cli` project:\n\n* `ember install ember-pdfjs`\n\nThis will add a `pdf-document` component to your application.\n\n## Standalone Sample\nThough this project is an `addon` type for including a component in your Ember project, you can also kick the tires on the component in a live sample with this project.\n\n````\ngit clone git@github.com:mysterlune/ember-pdfjs.git\ncd ember-pdfjs \u0026\u0026 npm install \u0026\u0026 bower install\nember serve\n````\n\n... and in typical Ember fashion, a development server will fire up on port `4200`. Then, simply visit:\n\n````\nhttp://localhost:4200\n````\n\n... and take a look at the familar, lovely \"tracemonkey\" document.\n\n## Usage\n\nIn a template, just do:\n\n````\n{{pdf-document src=[model.src]}}\n````\n\nor\n\n````\n{{pdf-document src=\"/path/to/your.pdf\"}}\n````\n\n`[model.src]` can be a `Uint8Array`, as `PDFJS` allows this as a source type for the `...getDocument()` signature.\n\n### Password Protected PDF Support\n\nThe addon also allows for the registration of an Ember action handler for use when a PDF is password protected.  In a template\nyou would add an action closure:\n\n````\n{{pdf-document src=[model.src] onPassword=(action 'myPasswordAction')}}\n\n````\n\nThe associated action handler would look something like the following:\n\n````\nimport { PasswordResponses } from 'ember-pdfjs/components/pdf-document';\n\nexport default Ember.Controller.extend({\n    actions: {\n        'myPasswordAction': function(setPassword, reason) {\n            // The reason value provides an indication of first prompt\n            // versus incorrect password prompt\n            let promptText = 'Enter the password to open this PDF file.';\n            if (reason === PasswordResponses.INCORRECT_PASSWORD) {\n                promptText = 'Invalid password. Please try again.';\n            }\n\n            // Prompt the user for their password in some application-specific way\n            let password = promptUserForPassword(promptText);\n\n            // Callback with the password received from the prompt\n            setPassword(password);\n        }\n    }\n});\n````\n\nThe action receives two parameters:\n * setPassword - A callback function that is used to set the password received from the user\n * reason - The \"reason\" that the password is being requested.  One of:\n   * PasswordResponses.NEED_PASSWORD (First time prompt)\n   * PasswordResponses.INCORRECT_PASSWORD (Re-prompt when previous password was incorrect)\n\n### Note on Security\nYou will get errors and it will not load if you try to link to something not hosted on your domain. You will need to update `contentSecurityPolicy` in your Ember project accordingly.\n\nCheckout [Ember Igniter](https://emberigniter.com/modify-content-security-policy-on-new-ember-cli-app/) for a how-to on updating `contentSecurityPolicy` for your app.\n\n\n## Caveats\nThe goals of this project are spelled out in [Issues](https://github.com/mysterlune/ember-pdfjs/issues/2). If there are recommendations that you need for own project, likely they will benefit others.\n\n## Running Tests\n\n* `ember test`\n\n## Contributing\nIf you have an \"ember-ish\"/\"pdf.js-ish\" addon project in the works -- or don't think this project will work for your needs -- please let's try to pull this together into one solution.\n\nThe Ember Community maintains a fundamental precept of common solutions to common problems. Proliferating addon solutions is kinda bunk, from a community perspective.\n\nPlease contribute!\n\n\u003e We confessed that we're not the only ones trying to climb the same mountain.\n\u003e\n\u003e -- \u003ccite\u003e[DHH](https://youtu.be/9naDS3r4MbY?t=882), on the character of the Rails Community\u003c/cite\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmysterlune%2Fember-pdfjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmysterlune%2Fember-pdfjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmysterlune%2Fember-pdfjs/lists"}