diff --git a/src/android/PrintManager.java b/src/android/PrintManager.java index 6f494b7..1ce5bc5 100644 --- a/src/android/PrintManager.java +++ b/src/android/PrintManager.java @@ -261,6 +261,7 @@ class PrintManager { boolean jsEnabled = settings.optBoolean("javascript", false); WebView view = new WebView(context); WebSettings spec = view.getSettings(); + JSONObject style = settings.optJSONObject("style"); spec.setDatabaseEnabled(true); spec.setGeolocationEnabled(true); @@ -268,7 +269,13 @@ class PrintManager { spec.setUseWideViewPort(true); spec.setJavaScriptEnabled(jsEnabled); - if (SDK_INT >= 21) { + if (style != null && style.has("size")) + { + spec.setDefaultFixedFontSize(style.optInt("size", 16)); + } + + if (SDK_INT >= 21) + { spec.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); CookieManager.getInstance().setAcceptThirdPartyCookies(view, true); }