android-pdfview icon indicating copy to clipboard operation
android-pdfview copied to clipboard

display pdf from url

Open GamalSebaee opened this issue 8 years ago • 4 comments

how i can display pdf from url or from server

GamalSebaee avatar Apr 30 '16 23:04 GamalSebaee

From server we can not load , need to download to local memory using volley and render from the local memory in to view.

sssvrock avatar May 02 '16 11:05 sssvrock

how i cam make user not able to see downloaded file or open it with any installed app

GamalSebaee avatar May 02 '16 19:05 GamalSebaee

you can save the files in your application memory, like get your application package path and then save there. Just google we can

private File getOutputMediaFile(){ // To be safe, you should check that the SDCard is mounted // using Environment.getExternalStorageState() before doing this. File mediaStorageDir = new File(Environment.getExternalStorageDirectory() + "/Android/data/" + context.getPackageName() + "/Files");

    // This location works best if you want the created images to be shared
    // between applications and persist after your app has been uninstalled.

    // Create the storage directory if it does not exist
    if (! mediaStorageDir.exists()){
        if (! mediaStorageDir.mkdirs()){
            return null;
        }
    }
    // Create a media file name
    String timeStamp = new SimpleDateFormat("ddMMyyyy_HHmm").format(new Date());
    File mediaFile;
    String mImageName="MI_"+ timeStamp +".jpg";
    mediaFile = new File(mediaStorageDir.getPath() + File.separator + mImageName);
    return mediaFile;
}

Just try this method to save the pdf at this location

sssvrock avatar May 03 '16 05:05 sssvrock

thanks , sir

GamalSebaee avatar May 03 '16 08:05 GamalSebaee