base64文件转pdf展示

//判断手机是否存在外部存储路径
if(Environment.getExternalStorageDirectory.equals(Environment.MEDIA_MOUNTED)){
true存在
}
//保存文件的路径
String savePath=Environment.getExternalStorageDirectory.getAbsolutePath+"";
//转成字节
byte[] buffer=Base64.decode(base64Code,Base64.DEFAULT);
//保存到本地
FileOutputStream out=new FileOutputStream(savePath);
out.write(buffer)
out.close;
//以pdf形式展示
https://github.com/barteksc/AndroidPdfViewer

你可能感兴趣的:(base64文件转pdf展示)