Php view pdf without download

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Question:

Hi All,

I’ve recently noticed that when I click on a pdf file, it goes into download and then I have to choose which software to open it with. It used to be that PDFs would automatically open without the long process of downloading and then selecting a software to view it with. I thought it was a chrome issue so tried Firefox and the same thing happens.

Does anyone know how I can stop PDF files from downloading but I can view them automatically?

I read up on how to do this but the solutions I found are more for a desktop than for a mobile device. Any help would be great. Thanks in advance

Posted on Mar 3, 2022 9:20 AM

User profile for user: Crush4

Question: How to view PDF instead of download

PDF documents are used all across the internet. Be it an invoice from an online shop, or a sales agreement, PDF is everywhere. One of the main arguments for using PDF as opposed to word processor files is the fact that the PDF file format is rendered exactly the same no matter the device. This trait is especially useful on the web, where getting something to look the same on different browsers isn’t always easy.

In this article, we’ll look at a simple approach for showing PDFs in an HTML app without using JavaScript by making use of the and

Live Example

If you’re curious how the above PDF will be rendered in your browser, check out the following example integration:

These simple HTML elements work in most desktop browsers and can be used to add PDF support to your web app without relying on JavaScript.

Problems with This Approach

This approach of displaying PDF documents is fast and requires no programming. There are, however, certain downsides: