Is there any way to display pdf generated using mpdf inline in mobile browsers?
I went through mpdf documentation and tried destination option mpdf->output('filename.pdf','I')
. It works pretty well across every browser in desktop except IE and doesn't work in mobile-browsers like Firefox, Chrome etc. It starts downloading automatically instead of displaying inline in IE in desktop and all mobile browsers.
Anyways to handle this?
Turns out that a new feature crept up in Google Drive's 2.3. 544.17 release on January 28. If you have that version or the newer 2.3. 583.13 installed, you'll see that tapping on PDF links in any app (SMS, Chrome, Twitter, WhatsApp, etc...) will immediately open Drive's PDF viewer and start loading them there.
Google Drive Viewer allows files to be viewed (without downloading) in Google Chrome for Android. By default, the file will open in a new tab.
Right click on your PDF document. Click on 'Open with'. Select Chrome or your browser of choice. You can also open PDFs in any other browser you use regularly.
I stumbled upon this StackOverflow post. You can also try Google embeddable PDF Viewer
As per the blog:
Google Docs offers an undocumented feature that lets you embed PDF files and PowerPoint presentations in a web page. The files don't have to be uploaded to Google Docs, but they need to be available online.
based on documentation :
I: send the file inline to the browser. The plug-in is used if available. The name given by $filename is used when one selects the “Save as” option on the link generating the PDF.
You need plug-in installed on your browser to embed the PDF document (Desktop and Mobile). If your browser doesn't has PDF Viewer plug-in, PDF document will be downloaded automatically.
You can use Javascript plugin such as pdfJs to embed your PDF document in cross browsers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With