After downloading a pdf as a base64 string with a request, I want to open a new tab and display the pdf with the "fit screen" option enabled.
The iframe code, where pdf
is the base64 string:
var win = window.open('', '', '');
win.document.write(`
<iframe src="data:application/pdf;base64,${pdf}" width=100% height=100%></iframe>
`);
This answers how to adjust settings with a filename as src:
<iframe src="filename.pdf#view=FitH"></iframe>
Unfortunately, src="base64string#view=FitH"
doesn't work. Any way to still accomplish this?