0

I have created url object with Blob and it's type is 'application/pdf'

const [url, setUrl] = useState('');
setUrl(URL.createObjectURL(mediaSource)); // mediaSource is a Blob
useEffect(() => {
if (url) window.open(url, '_blank')
[url]);

By this useEffect(), url is opening in another tab but pdf occupying less space and added scroll bars to it

Partially loading image

If I copy and paste same url in another chrome tab it is working as expected Expected image

I tried these, but nothing work. Please help !

window.open(url, '_blank', "height=500");
window.open(url, '_blank', "fullscreen=yes");
  • Could you try `useEffect(() => { if (url) { const win = window.open(url, '_blank'); win.onload = () => { win.resizeTo(screen.availWidth, screen.availHeight); }; } }, [url]);` – Deepak Thomas Apr 30 '23 at 03:04

0 Answers0