.bin File is downloading in flutter webview instead a pdf file - android

I am downloading a pdf file in webview(flutter_inappwebview),but after downloading i see .bin extension file,The pdf downloading page is locked behind login,so i tried including headers like cookies,userAgents
please solve the my question ?

Govt Website Restrict Download of pdf ,So i finally generated own pdf

Related

Reading pdf file from firebase

Can anyone tell me how can i read a pdf file directly into my android app without downloading it from firebase?
I have uploaded a pdf file in firebase storage and now i want to read that file in my app without downloading it.
It's very simple
Use a web view in your layout and load the firebase pdf file url into your webview.

Android download file from url

I am developing a simple web browser and faced with a problem. I use DownloadManager to download files from download requests. But I can't download files from GET requests like this: somewebsite.php?t=432513. When I'm trying to download file from such links using DownloadManager I got 1kb file of unknown format. Note, that I can download this file with Chrome or any other browser. Can anyone help me? Thanks in advance.
it's because you are using Query parameter ##somewebsite.php?t=432513## , which return html page not the file. for downloading the file, the URL should have file in it.

ANDROID - How to open a pdf url which does not have a .pdf extension?

I am trying to open a url which is actually a pdf file but it does not have .pdf extension in android webview BUT it does not works. It directly downloads. But when i open the url in WEB browser, the pdf file opens perfectly.
Since this url does not have .pdf extension, I can not use google docs as well. Also tried to download and open the file using any pdf viewer app, it also fails. The main reason is my Url does not have .pdf extension. Is there any other solution?
I think you are not setting the content type as pdf(MIME). Thats why you are getting problem when you are downloading the pdf content.
See this post for more details.
Proper MIME media type for PDF files
MIME TYPES
Render a PDF file using Java on Android
you can see this .pdf extension is not necessary

Using Pdf.js in Android hybrid app to load local files

I am developing an app for android using Sencha touch and Cordova which needs to load PDF files.I found the Child browser support on PDF is not there for Android.So I decided to use PDF.js.I am using the following line of code to open the PDF file :
window.open(\''+ ROOT_FOLDER+'/app/util/PDFJS/web/viewer.html?file='+ROOT_FOLDER + '<Path to PDF file>\'
ROOT_FOLDER is the local file path URL like file://app/utils.."
But the pdf is not loading in this case and it is throwing an exception like
XMLHttpRequest cannot load file:///android_asset/www/<path to PDF file>. Cross origin requests are only supported for HTTP.
Please let me know how to fix this issue, or how to load PDF files from local location using PDF.js
If you want to load the files from local location, then it should be present in the same folder with viewer.html. In short the PDF should not be outside the main folder where all these html and js files are present.

Open.ai (adobe illustrator) file as a PDF

Is it possible to load .ai files and open them programmatically?
I wanted to convert .ai files to pdf files and want to show it.I know how to do it in iOS but don't know how to acheive it in android.
any tutorial link or suggestion would be appreciable.
To open a .Ai file it needs to have PDF Embedded in it, That`s an option you get when saving a .Ai file through Adobe Illustrator (include PDF Compatibility).
If the .Ai file has that, then all what you need to do is rename it to .PDF instead of .Ai, then open it using a PDF Viewer like: http://www.mupdf.com/

Categories

Resources