Limitations on opening pdf file in Android

前端 未结 6 1488
暗喜
暗喜 2021-02-11 15:04

I am trying to opening some pdf from my Android application. I am using an Intent for doing that:

Intent intent = new Intent();
intent.setDataAndType(Uri.parse(u         


        
6条回答
  •  灰色年华
    2021-02-11 16:00

    Simple add following library for android:

    //in app level build
    compile 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'
    
    //inside your xml file
    
    
    //inside java code
     pdfView.fromAsset(pdfName)
    .pages(0, 2, 1, 3, 3, 3)
    .defaultPage(1)
    .showMinimap(false)
    .enableSwipe(true)
    .onDraw(onDrawListener)
    .onLoad(onLoadCompleteListener)
    .onPageChange(onPageChangeListener)
    .load();
    

    for more info, use this GitHub link: https://github.com/JoanZapata/android-pdfview

提交回复
热议问题