Open AlejandroGomz opened 3 years ago
Hi,
when I use onRender(new OnRenderListener(), the PDF is not displayed. If I don't use the RenderListener, the PDF document is displayed. What am I doing wrong?
Android API 30 implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
pdfView=findViewById(R.id.pdfv); pdfView.useBestQuality(true); pdfView.fromUri(uri) .onError(e -> Log.e(TAG, "openPDFFile Error: "+e)) .nightMode(false) .onLoad(nbPages -> { Log.d(TAG, "openPDFFile..load completed"); }) .onRender(new OnRenderListener() { @Override public void onInitiallyRendered(int nbPages) { Log.d(TAG, "openPDFFile..render completed nbPages: "+nbPages); pdfView.fitToWidth(nbPages); } }) .load();
It seems, that fitToWidth() makes some troubles, because onLoad() is faster then onRender()?
Do not use the param nbPages, you have to use the page number that is visible at this moment
Hi,
when I use onRender(new OnRenderListener(), the PDF is not displayed. If I don't use the RenderListener, the PDF document is displayed. What am I doing wrong?
Android API 30
implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
It seems, that fitToWidth() makes some troubles, because onLoad() is faster then onRender()?