{"id":15184841,"url":"https://github.com/androidovshchik/angularepubviewer","last_synced_at":"2025-10-02T00:31:38.430Z","repository":{"id":57178359,"uuid":"127703500","full_name":"androidovshchik/AngularEpubViewer","owner":"androidovshchik","description":"Angular library based on Epub.js","archived":true,"fork":false,"pushed_at":"2019-04-18T12:54:44.000Z","size":117,"stargazers_count":11,"open_issues_count":6,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-30T01:10:15.303Z","etag":null,"topics":["angular","epub","ionic","library"],"latest_commit_sha":null,"homepage":"https://androidovshchik.github.io/AngularEpubViewer","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/androidovshchik.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":"2018-04-02T04:43:50.000Z","updated_at":"2024-03-19T19:06:32.000Z","dependencies_parsed_at":"2022-09-09T17:11:32.978Z","dependency_job_id":null,"html_url":"https://github.com/androidovshchik/AngularEpubViewer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/androidovshchik%2FAngularEpubViewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/androidovshchik%2FAngularEpubViewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/androidovshchik%2FAngularEpubViewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/androidovshchik%2FAngularEpubViewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/androidovshchik","download_url":"https://codeload.github.com/androidovshchik/AngularEpubViewer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234916159,"owners_count":18906643,"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":["angular","epub","ionic","library"],"created_at":"2024-09-27T17:40:57.550Z","updated_at":"2025-10-02T00:31:38.119Z","avatar_url":"https://github.com/androidovshchik.png","language":"TypeScript","funding_links":["https://www.paypal.me/mrcpp"],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003eAngularEpubViewer\u003c/h1\u003e\n\n\u003cp\u003e\n  \u003ca href=\"https://www.npmjs.com/package/angular-epub-viewer\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/angular-epub-viewer.svg?style=flat\" height=\"18\" alt=\"downloads\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/angular-epub-viewer\"\u003e\n    \u003cimg src=\"https://badge.fury.io/js/angular-epub-viewer.png\" height=\"18\" alt=\"npm version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://david-dm.org/androidovshchik/AngularEpubViewer\" title=\"dependencies status\"\u003e\n    \u003cimg src=\"https://david-dm.org/androidovshchik/AngularEpubViewer/status.svg\" height=\"18\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.paypal.me/mrcpp\" title=\"Donate to this project using Paypal\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/paypal-donate-green.svg\" alt=\"PayPal donate button\" height=\"18\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nThis is a simple epub viewer component for angular4+ websites.\n\nAll issues and pull requests are welcome!\n\n### Demo page\n\n[https://androidovshchik.github.io/AngularEpubViewer](https://androidovshchik.github.io/AngularEpubViewer)\n\n### Getting started\n\n```\nnpm install epubjs@0.2.x --save\nnpm install angular-epub-viewer --save\n```\n\n*(Actual version of the 2-nd branch for epub.js may be found [here](https://www.npmjs.com/package/epubjs))*\n\nThen add **required** `epub.js` script to your `.angular-cli.json`\n\n```\n{\n  ...\n  \"apps\": [\n    {\n      ...\n      \"scripts\": [\n        \"../node_modules/epubjs/build/epub.js\",\n        ...\n      ]\n    }\n  ]\n}\n\n```\n\nOptional scripts:\n\n\u003e `\"../node_modules/epubjs/build/hooks.js\"`\n\u003e\n\u003e includes [default plugins](https://github.com/futurepress/epub.js/tree/master/hooks/default)\n\n\u003e `\"../node_modules/epubjs/build/libs/zip.min.js\"` *(recommended)*\n\u003e\n\u003e includes [JSZip.js library](https://github.com/Stuk/jszip)\n\n\u003e `\"../node_modules/epubjs/build/libs/localforage.min.js\"`\n\u003e\n\u003e includes [localForage.js library](https://github.com/localForage/localForage)\n\nOther official plugins may be found [here](https://github.com/futurepress/epub.js/tree/master/hooks/extensions)\n\nIn folder `add-ons` are also available my own hooks, include them such way:\n\n`\"../node_modules/angular-epub-viewer/add-ons/YOUR_CHOSEN_HOOK_NAME.js\"`\n\n### Supporting IE\n\nCompatibility coming with [wicked-good-xpath](https://github.com/google/wicked-good-xpath)\n\nInclude these scripts in `.angular-cli.json`:\n\n```\n\"../node_modules/epubjs/examples/wgxpath.install.js\",\n\"../node_modules/epubjs/hooks/extensions/wgxpath.js\"\n```\n\n[More info here](https://github.com/futurepress/epub.js#internet-explorer)\n\n### An example of usage\n\n`*.module.ts` file\n\n```js\nimport { AngularEpubViewerModule } from 'angular-epub-viewer';\n\n@NgModule({\n  ...\n  imports: [\n    ...\n    AngularEpubViewerModule\n  ]\n})\n```\n\n`*.component.html` file\n\n```html\n\u003cangular-epub-viewer #epubViewer\u003e\u003c/angular-epub-viewer\u003e\n\u003cinput type=\"file\" accept=\"application/epub+zip\" (change)=\"openFile($event)\"\u003e\n\u003cbutton (click)=\"epubViewer.previousPage()\"\u003ePrevious page\u003c/button\u003e\n\u003cbutton (click)=\"epubViewer.nextPage()\"\u003eNext page\u003c/button\u003e\n```\n\n`*.component.ts` file\n\n```js\n@Component({\n  ...\n})\nexport class AppComponent {\n\n  @ViewChild('epubViewer')\n  epubViewer: AngularEpubViewerComponent;\n\n  openFile(event) {\n    this.epubViewer.openFile(event.target.files[0]);\n  }\n}\n```\n\n### API documentation\n\nFields:\n\n| Signature | Short Description |\n| :------------- |:-------------|\n| `epub: ePub` | Primary object |\n| `root: ElementRef` | Root container's DOM reference |\n| `currentLocation: EpubLocation` | Current location of document's rendered part |\n| `documentReady: boolean` | Indicates whenever document is ready |\n| `isChapterDisplayed: boolean` | Indicates whenever chapter is displayed |\n| `computingPagination: boolean` | Indicates whenever pagination is computing |\n| `searchingText: boolean` | Indicates whenever searching text |\n\nInput parameters:\n\n| Signature | Default value | Short Description |\n| :------------- |:-------------|:-------------|\n| `padding: string` | `null` | Root container's padding in px, em, etc |\n| `autoPagination: boolean` | `false` | Enables auto calculate of pagination after document is ready or viewport has been changed |\n| `autoMetadata: boolean` | `false` | Enables auto loading of metadata after document is ready |\n| `autoTOC: boolean` | `false` | Enables auto loading of table of contents after document is ready |\n\nOutput events:\n\n| Signature | Short Description |\n| :------------- |:-------------|\n| `onDocumentReady: EventEmitter\u003cvoid\u003e` | Get event when document is loaded |\n| `onChapterUnloaded: EventEmitter\u003cvoid\u003e` | Get event when chapter is unloaded  |\n| `onChapterDisplayed: EventEmitter\u003cEpubChapter\u003e` | Get event when chapter is displayed  |\n| `onLocationFound: EventEmitter\u003cEpubLocation\u003e` | Get event about the current location |\n| `onSearchFinished: EventEmitter\u003cEpubSearchResult[]\u003e` | Get event about search results  |\n| `onPaginationComputed: EventEmitter\u003cEpubPage[]\u003e` | Get event about pagination |\n| `onMetadataLoaded: EventEmitter\u003cEpubMetadata\u003e` | Get event about metadata |\n| `onTOCLoaded: EventEmitter\u003cEpubChapter[]\u003e` | Get event about table of contents |\n| `onErrorOccurred: EventEmitter\u003cEpubError\u003e` | Get event when any error occurred |\n\nMethods:\n\n| Signature | Short Description |\n| :------------- |:-------------|\n| `openLink(link: string): void` | Opens EPUB document by link |\n| `openFile(file: File): void` | Opens EPUB document file |\n| `goTo(location: string or number): void` | Navigates to the specified url or EPUB CFI or page |\n| `nextPage(): void` | Navigates to the next page |\n| `previousPage(): void` | Navigates to the previous page |\n| `searchText(text: string): void` | Searches all text matches *in the current chapter* |\n| `setStyle(style: string, value: string): void` | Adds style to be attached to the document's body element |\n| `resetStyle(style: string): void` | Removes a style from the rendered document |\n| `computePagination(): void` | Calculates pagination as output event |\n| `loadMetadata(): void` | Loads metadata as output event |\n| `loadTOC(): void` | Loads table of contents as output event |\n\n### Running demo from sources\n\n```\ngit clone https://github.com/androidovshchik/AngularEpubViewer.git\ncd AngularEpubViewer\ngit submodule update --init --recursive\nnpm install\nnpm start\n```\n\nOpen http://localhost:4200 in browser\n\n### License\n\n\u003cimg src=\"https://raw.githubusercontent.com/androidovshchik/AngularEpubViewer/master/art/gplv3-127x51.png\"\u003e\n\n### Other\n\nEPUB is a registered trademark of the [IDPF](http://idpf.org/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroidovshchik%2Fangularepubviewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandroidovshchik%2Fangularepubviewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroidovshchik%2Fangularepubviewer/lists"}