void ReadiumJSApi::updateSettings(ViewerSettings viewerSettings) { try { std::string str = json::Serialize(viewerSettings.toJSON()); loadJSOnReady(std::string("ReadiumSDK.reader.updateSettings(") + str + ");"); } //catch (JSONException e) { // Log.e(TAG, "" + e.getMessage(), e); //} catch (...) { // Log.e(TAG, "" + e.getMessage(), e); } }
void ReadiumJSApi::openBook(PackagePtr pckg, ViewerSettings viewerSettings, OpenPageRequest openPageRequestData) { json::Object openBookData; try { openBookData["package"] = getPackageJSON(pckg); openBookData["settings"] = viewerSettings.toJSON(); openBookData["openPageRequest"] = openPageRequestData.toJSON(); } catch (...) { // Log.e(TAG, "" + e.getMessage(), e); } //catch (JSONException e) { // Log.e(TAG, "" + e.getMessage(), e); //} std::string str = json::Serialize(openBookData); loadJSOnReady("ReadiumSDK.reader.openBook(" + str + ");"); }