google-chrome – Generate Base64 PDF


I have an API in laravel that generates a PDF with laravel snappy.

It works perfectly on chrome linux but on windows that have the newest version of chrome it doesn't work, chrome just opens a blank page.

I get base 64 like this:'data:application/pdf;charset=utf-8;base64,' +;


A partir da versão 60 do Chrome, as URLs top-frame foram bloqueadas, como segue:


We intend to block web pages from loading data: URLs in the top frame using tags,, window.location and similar mechanisms.


data: URLs are generally a source of confusion for users. Because of their unfamiliarity and ability to encode arbitrary untrusted content in a URL, they are widely being used in spoofing and phishing attacks. Another problem is that they can be passed along without a backing page that runs JavaScript (e.g. a data URL can be sent via email). For that reason, we intend to block top-frame navigations to data URLs.


Renderize o seu PDF em um <object>

var base64 = 'seuBase64';
var novaJanela ="", "PDF", 'dependent=yes,locationbar=no,scrollbars=no,menubar=no,resizable,screenX=50,screenY=50,width=850,height=800');
novaJanela.document.write('<html><body><object width=100% height=100% type="application/pdf" data="data:application/pdf;base64,' + base64 + '"><embed type="application/pdf" src="data:application/pdf;base64,' + base64 + '"></embed></object></body></html>');
Scroll to Top