Developed by Visit Scand.com Scand Ltd. Contact dev team

epuBearepubear logo

Lightweight easily customizable
cross-platform EPUB SDK
for EPUB reader development

EpuBear SDK Public API

Cross-platform close Core of epuBear SDK provides the following basic functionality:

  • Open, Unpack and Parse EPUB Documents
  • Get EPUB Document Info
  • Render Pages to Bitmaps
  • Go to Page
  • Go to Chapter
  • Open Link
  • Change Font Size
  • Switch to DoublePage Mode
  • Switch to Night Mode
  • Use Custom Fonts
  • Change Page Background
  • Replace Default CSS
custom edition only

If you want more functionality/public API than epuBear SDK provides we can certainly extend it for you.

How to use

This EPUB SDK is a C++ solution and we prepared native wrappers in Java (Android), Swift (iOS) and C# (Xamarin) for our EPUB toolkit to be compatible with your project. The code of the wrappers acts as proxy between the native code and the core.

                        /*  Initialization  */

import com.epubear.EpubearSdk;

public class EpubearView extends View implements EpubearSdk.EventListener {

    private EpubearSdk epubear;
    private Map bitmaps;

    public EpubearView(Context context) {
        ....
        //  create instance
        epubear = new EpubearSdk(context, dataDir, userName, userKey);
        epubear.setEventListener(this);
        ....
    }

    @Override
    public void onSizeChanged(int w, int h, int oldw, int oldh) {
        ....
        //  init sdk with target width/height
        epubear.updateBitmapSize(w, h);
        ....
    }

    @Override
    public void doInitDisplay() {
        ....
        //  create bitmaps
        //  register bitmaps in sdk
        for (Map.Entry entry : bitmaps.entrySet())
            epubear.registerBitmap(entry.getKey(), bitmap.getValue());
        ....
    }
}

/*  Navigation  */

//  open epub
epubear.openFile(path);

//  go to next page
epubear.openNextPage();

//  go to previous page
epubear.openPreviousPage();

//  go to target page
epubear.openPage(n);

//  get Table of Contents
Map tocList = epubear.tableOfContents();

//  open chapter from table of contents
epubear.openChapter(caption);

//  font increase
epubear.increaseFont();

//  font increase
epubear.decreaseFont();

/*  Image Cache */
....
FragmentManager fm = getSupportFragmentManager();
if (!epubear.hasImageCache())
    epubear.useImageCache(fm, cacheSize);
....
                    
                        
// SDK initialization and book opening, if book cannot be opened returns nil
// BookViewController.swift

override func viewWillAppear(animated: Bool) {
		...
        epubearInstance = EPUBearSDK(bookPath: self.bookPath, withCachePath: self.cachePath)
        ...
        }
        
override func viewDidLayoutSubviews() {
		...
		let scale = UIScreen.mainScreen().scale;
		let scaledSize = CGSize(width: view.bounds.size.width * scale, height: view.bounds.size.height * scale);
		epubearInstance.resizeBitmapsIfNeeded(scaledSize);
		...
		}

// Bitmaps getters
epubearInstance.centerImage();
epubearInstance.leftImage();
epubearInstance.rightImage();

// Navigation through book
epubearInstance.openNextPage();
epubearInstance.openPreviousPage();
epubearInstance.openPage(page);

// Navigation through chapters
epubearInstance.openChapterAtIndex(index);

// Change font size
epubearInstance.increaseFont();
epubearInstance.decreaseFont();
                    
                 	 // BookViewController.cs

private EPUBearSDK _epubear;

public override void ViewDidLoad()
{
	base.ViewDidLoad();

	var bookPath = (Element as BookPage).BookPath;
	var cachePath = (Element as BookPage).CachePath;

	_epubear = new EPUBearSDK(bookPath, cachePath);
	_epubear.WeakDelegate = this;	// to handle callbacks
}

public override void ViewDidLayoutSubviews()
{
	...
	var viewSize = View.Bounds.Size;
	var scale = UIScreen.MainScreen.Scale;
	var scaledSize = new CGSize(viewSize.Width * scale, viewSize.Height * scale);
	_epubear.ResizeBitmapsIfNeeded(scaledSize);
	...
}

// Book Navigation
_epubear.OpenChapterAtIndex(chapterIndex);
_epubear.OpenPage(pageNumber);
_epubear.OpenPreviousPage();
_epubear.OpenNextPage();

// Change font size
_epubear.IncreaseFont();
_epubear.DecreaseFont();

// Way to access rendered pages as CGImage objects
var pages = new CGImage[3];
pages[0] = _epubear.LeftImage;
pages[1] = _epubear.CenterImage;
pages[2] = _epubear.RightImage;

// Way to check first && last pages
_epubear.CanScrollToLeft;
_epubear.CanScrollToRight;

// Way to change night\normal mode
_epubear.SetAppearanceMode(EPUBAppearanceMode);

// Framework delegate methods
IEPUBearSDKDelegate.ContentUpdated();
IEPUBearSDKDelegate.PageCountChanged(pageCount);
                    

EpuBear Demo Apps

Demo apps demonstrate the full-functionality of epuBear SDK. Feel free to use them, decide on the benefit brought to your business and make up your mind concerning our possible cooperation. Besides, the apps show the benchmark report of epuBear performance.

Main Functions

  • Compatibility with EPUB 2 format;
  • Navigation through pages and chapters;
  • Night mode;
  • Font size change;
  • Embedded links support;

Pricing

  • 1 Binary Licence
  • 1 Application
  • 1 Mobile Platform
$ 999
$ 499
Android:
1
iOS:
0
Xamarin:
0

If you realize that you want to have some additional functionality, please, let us know and we could help to build your very own EPUB reader based on epuBear SDK








Thank you! We appreciate your time and will reach you as soon as possible!