nativescript-epub-reader
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

nativescript-epub-reader

NativeScript plugin to open and read ePub files natively.

Getting Started

  • npm install nativescript-epub-reader
  • For iOS Place your epub files in your App_Resources/iOS directory.
  • For Android, required absolute file path as parameter.
  • Import EpubReader in your page and open the file.

Android Permissions Required

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

AndroidManifest

Starting with Android 9.0 (API level 28), cleartext support is disabled by default.

{your-app-module}/res/xml/network_security_config.xml

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">127.0.0.1</domain>
        <domain includeSubdomains="true">localhost</domain>
    </domain-config>
</network-security-config>

Then add network_security_config.xml in your app module's AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
    ...
    <application android:networkSecurityConfig="@xml/network_security_config">
    ...
    </application>
</manifest>

Code Sample

import {Observable} from 'data/observable';
import { EpubReader } from 'nativescript-epub-reader';
import * as application from "tns-core-modules/application";

export class HelloWorldModel extends Observable {

  constructor() {
    super();
    let ePubReader = new EpubReader();
    if (application.android) {
        ePubReader.open('/storage/emulated/0/Download/Metamorphosis-jackson.epub');
    }else{
        ePubReader.open('book');
    }
  }

}

IOS Demo

Image

Android Demo

Custom Fonts

Custom fonts

Day and Night Mode

Day night mode

Text Highlighting

Highlight

Media Overlays

Media Overlay

Credits

License

Apache License Version 2.0, January 2004

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i nativescript-epub-reader

    Weekly Downloads

    0

    Version

    1.0.0

    License

    Apache-2.0

    Unpacked Size

    52.9 kB

    Total Files

    18

    Last publish

    Collaborators

    • pravinkumarputta