In order to dispalay base64 string as pdf in new tab use Javascript. // `myBase64String` is your base64 data which can come, // from sources such as a server or the filesystem. The following JavaScript code will open https://www.codexworld.com in a new browser tab or window. I am trying to open up this string in a new window as a PDF file. When are you supposed to use escape instead of encodeURI/encodeURIComponent? Specifies the URL of the page to open. You one-line base64 string isn't really base64. This is default; _parent - URL is loaded into the parent frame This allow you to pass a different pdf document to be opened instead of the original passed in `printable`. For some developers, it's easy to return a base64 string of files from the server. Blob has a specific size and file type just like ordinary files and it can be stored and retrieved from the system memory. Open a Base64 PDF from Lightning Component JavaScript in new Tab. For some developers, it's easy to return a base64 string of files from the server. Angular & JavaScript | Open Blob URL View PDF and Images in New Tab In this JavaScript quick tutorial, we’ll learn how to select a file using a File input control to convert it into a Base64 URL, also add a View button to preview the selected file by opening in the new Chrome tab by creating a BLOB url. Just a reminder, the Adobe Forums are transitioning to a new community experience soon. I'm hoping for a script to do it rather than having to comb through the entire site and edit all the links. Normally, PDF files are allowed to be viewed in your desktop browser using a simple window.open function : window.open("data:application/pdf;base64,JVBERi0xLjcKCjEgMCBv...","_blank"); Here is the code that is working to download the pdf but I want to be able to open up and view the pdf within response.getReturnValue in a new tab. This visual utilizes the PDF JS javascript library (https://mozilla.github.io/pdf.js/) to display PDF documents from base64 encoded strings. window.open(URL.createObjectURL(blob)); This doesn't seem to be gif.js specific, but probably good to explore other options, or at least note it in the documentation. In order to dispalay base64 string as pdf in new tab use Javascript. The JavaScript window.open() method opens a new browser window. I tested on another PC with windows 8.1 and IE 11. Open a document. I am here to help you. Blob is the underlying data structure for the File object and the FileReader API. Use _blank in the second parameter of window.open() method to open a URL in a new tab using JavaScript. I want it to recognize that this is a PDF file. Programmatically opening a pdf blob from an api in a new tab. Once you got the base64 string you need to convert it to byte array and display the byte array as pdf in new tab. In addition, I’ll show how to embed PDF into HTML page and create a link to download the PDF. Approach: To open a new tab, we have to use _blank in second parameter of window.open(). It looks like window.open will take a Data URI as the location parameter. I'm very new to JavaScript and MVC and didn't know wheather to post this in MVE or javascript forum. window.open ("data:application/pdf;base64," + pdfBase64String) works in Chrome, Firefox, and Safari. Unlimited usage. Below is some example code showing how to convert base64 to a Blob. Questions are automatically locked after two months of … My system is windows 7 with IE 11. For this example i have used database to fetch the base64 string. Active 1 year, 4 months ago. Based on the question Open PDF in new browser full window, it looks like I can use JavaScript to open a new window with a PDF file with the following code: I'd like to do so on a return trip from the server by adding a byte array instead of the file name to use as the URL location in window.open. By the way, in addition to