Open Siahkali opened 2 years ago
Hi, You can not load pdf directly from the URL. First, you need to download it to the local storage of your device and then load it using the file like this
String url = BaseURL + "67038.pdf";
AsyncTask.execute( new Runnable() {
@Override
public void run() {
try {
final InputStream input = new URL( url ).openStream();
runOnUiThread( new Runnable() {
@Override
public void run() {
pdfView.fromStream( input )
.defaultPage( finalDefaultValue )
.enableSwipe( true )
.swipeHorizontal( true )
.pageSnap( true )
.autoSpacing( true )
.nightMode( isChecked )
.pageFling( true )
.enableAnnotationRendering( true )
.scrollHandle( new DefaultScrollHandle( mContext ) )
.load();
progressBar.setVisibility( View.INVISIBLE );
}
} );
} catch (IOException e) {
e.printStackTrace();
}
}
} );
Let me know if it helps you
Ok thanks
Hi FromUri doesn't work "Without any errors and reactions"