
What is the proper wya to implement the angular service and component in order to open the pdf document into new tab. open pdf file in new tab using angular 6. in angular, i need to open a pdf in a new tab and angular open base64 pdf in new tab allow the user to download it with a specific name ( example. 37 i have to display base64 pdf in new tab. base64; let pdfwindow = window. i am using below code var windo = window. share improve this answer follow. i want to open that pdf in a new tab. open ( " " ) pdfwindow. write ( objbuilder) ;.
3 answers sorted by: 19 var pdfresult = response. the code below downloads the pdf however doesn' t open a new tab ( target= _ blank is not working). display pdf in base64 in a new tab in ipad ( safari or chrome for ios) ask question asked 2 years, 6 months ago modified 2 years, 6 months ago viewed 3k times 0 i am working in an angular web app, in which i am getting a base64 string from a backend api, which represents a pdf file. write ( " < iframe width= ' 100% ' height= ' 100% ' src= ' data: application/ pdf; base64, " + encodeuri ( pdfresult) + " ' > < / iframe> " ) this serves to display the base64 pdf in a browser tab.
open ( " ", " " ) ; var objbuilder = ' ' ; objbuilder + = ( ' < embed width= \ ' 100% \ ' height= \ ' 100% \ ' src= " data: application/ pdf; base64, ' ) ; objbuilder + = ( filedata) ; objbuilder + = ( ' " type= " application/ pdf" / > ' ) ; windo. any ideas how to fix this?