pramodkr123 / ConvertWebViewToPdfDemo

Convert WebView to pdf in android
MIT License
40 stars 19 forks source link

PDF Background color issue #13

Open JagadishaIncture opened 3 years ago

JagadishaIncture commented 3 years ago

Hi Iam trying to save pdf from webview. everything was working fine but recently we found one issue .

in webview i can see some background colors but after pdf is genrated i cant see any color sin tht pdf file

JagadishaIncture commented 3 years ago

My Code : final ProgressDialog progressDialog = new ProgressDialog(WebViewActivity.this); progressDialog.setMessage("Downloading...");

            try {

                progressDialog.show();

                PdfView.createWebPrintJob(WebViewActivity.this, webView, myDir, fileName, new PdfView.Callback() {

                    @Override
                    public void success(String path) {
                        progressDialog.dismiss();

                        openFileView(file);

                        //PdfView.openPdfFile(WebViewActivity.this, getString(R.string.app_name), "Do you want to open the pdf file?" + fileName, path);
                    }

                    @Override
                    public void failure() {
                        progressDialog.dismiss();
                        Toast.makeText(WebViewActivity.this, "SomeThing Went Wrong while Downloading", Toast.LENGTH_SHORT).show();

                    }
                });

            } catch (Exception e) {
                FirebaseCrashlytics.getInstance().recordException(e);
                progressDialog.dismiss();
                Toast.makeText(this, "Downloading Failed Try again Later!!", Toast.LENGTH_SHORT).show();
            }`
JagadishaIncture commented 3 years ago

This Screenshot in WebView

Screenshot_20210817-101132

JagadishaIncture commented 3 years ago

This screenshot after converted to PDF Note : No Colors reflecting

Screenshot_20210817-101142