1

1) I want to download the PDF using voghDev/PdfViewPager library through a URL.

2) The downloaded PDF should be stored in the users internal memory.

I am able to directly view the pdf from the url but unable to actually download it.

RemotePDFViewPager remotePDFViewPager = new RemotePDFViewPager(context, MyUrlContainingDownloadablePFDLink, this); remotePDFViewPager.setId(R.id.pdfViewPager);

The XML.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/remote_pdf_root"
    android:orientation="vertical"
    android:background="#FFFFFF"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <es.voghdev.pdfviewpager.library.PDFViewPager
        android:id="@+id/pdfViewPager"
        android:layout_width="match_parent"
        android:layout_height="480dp"/>


</LinearLayout>

By using the above code I can view the pdf from the link but cannot download it.

Link to the library on Github

How do I download it ?

Randy Orton
  • 33
  • 1
  • 7
  • Just in the same way you would download any file. Using DownloadManager for example. – blackapps May 04 '21 at 20:12
  • `public void onSuccess(String url, String destinationPath)` Have you inspected `destinationPath` ? – blackapps May 04 '21 at 20:17
  • I read this code and also tried implementing it but I cannot find a way to work it out. And also I cannot understand what this destinationPath actually means. Can you help me figure it out – Randy Orton May 04 '21 at 20:21
  • As far as my understanding goes this function does not return anything so how can I store the pdf downloaded by providing its **url** into a variable ? need some guidance :) – Randy Orton May 04 '21 at 20:24
  • You should look what the value of destinationPath is to begin with. That is what i suggested. Could be that the downloaded file is already saved in that path was my idea. – blackapps May 04 '21 at 21:56

0 Answers0