There are two approaches...

One: open the PDF link in a new tab/window and make sure to set the
Content-Type appropriately.
Two: use pdf.js (from Mozilla) to display the PDF in your page.

We used pdf.js because it gave us greater control and made the experience
consistent across browsers.

On Thu, Nov 9, 2017 at 3:10 PM Reza Razavipour <[email protected]>
wrote:

> I have an angular 4 app. I have html anchors to outside resources such as
> pdf file.
> When I click on the anchors, the files are downloaded and the user has to
> explicit load
> them.
>
> This approach has a number of problems. I only want the user to view the
> data in one step, as in
> auto opening the pdfs.
>
> Any suggestions on how to do this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Angular and AngularJS discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Lucas Lacroix
Computer Scientist
Advanced Technology Division, MEDITECH <http://ehr.meditech.com/>
781-774-2293

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to