Issue 162833 in chromium: Loading new Blob constructed PDF-file into iframe fails.

111 views
Skip to first unread message

chro...@googlecode.com

unread,
Nov 27, 2012, 7:15:17 AM11/27/12
to chromi...@chromium.org
Status: Unconfirmed
Owner: ----
Labels: Type-Bug Pri-2 Area-Undefined OS-Windows

New issue 162833 by attek...@gmail.com: Loading new Blob constructed
PDF-file into iframe fails.
http://code.google.com/p/chromium/issues/detail?id=162833


Tested on:

OS: Window 7 x64
Chrome: 23.0.1271.91 (Official Build 167501) m and 25.0.1335.0 (169404)
canary

I have a html-page which has an iframe in it. I want to fetch a pdf-file
from server with a websocket connection and then load that file into the
iframe. On Linux the following javascript-snippet loads pdf-files into the
iframe but on Windows with the same script I can see from developer console
that the iframe has blob as a source but the file is not rendered and the
onload-event is not triggered. I can use the same javascript to load
html-files, mht-files etc. into the iframe with the right mime-type on both
Windows and Linux.

I tried with multiple different mime-types for the pdf-file but none of
them worked on Windows. 'text/pdf' gave the pdf-file content as a text into
the iframe but that doesn't help much.

And yes I have a really good reason to use this way of loading the
pdf-files into the browser.

javascript-snippet:
.
.
.
var target=document.getElementById('target')
target.src=(window.URL || window.webkitURL).createObjectURL(new
Blob([data],{type:'application/pdf'}))
.
.
.

the variable data is the binary-stream of the PDF-file conten from the
websocket-server.

HTML:

<html>
<head>
<script>
...Javascript...
</script>
</head
<body>
<iframe id='target' width=100% height=1000
onload=setTimeout(fetchNext,300)></iframe>
</body>
</html>


chro...@googlecode.com

unread,
Nov 28, 2012, 4:38:29 PM11/28/12
to chromi...@chromium.org

Comment #1 on issue 162833 by attek...@gmail.com: Loading new Blob
constructed PDF-file into iframe fails.
http://code.google.com/p/chromium/issues/detail?id=162833

I can save the blob as a file with a name
like "b6640483-8d65-4ddb-95bb-42b338dbe891" if I add .pdf prefix and open
the file in Chrome it works right. So the blob itself doesn't seem to be
incorrect but for some reason the iframe doesn't like the object created.
Just to be sure I tried to open a pdf-file into an iframe with <iframe
src='./test.pdf'></iframe> and that worked.

chro...@googlecode.com

unread,
Dec 2, 2012, 3:39:55 AM12/2/12
to chromi...@chromium.org

Comment #2 on issue 162833 by attek...@gmail.com: Loading new Blob
constructed PDF-file into iframe fails.
http://code.google.com/p/chromium/issues/detail?id=162833

The fault was somewhere in my machine. Removing and reinstalling chrome
solved the issue.

chro...@googlecode.com

unread,
Feb 25, 2013, 4:24:50 AM2/25/13
to chromi...@chromium.org
Updates:
Status: WontFix

Comment #3 on issue 162833 by ri...@chromium.org: Loading new Blob
constructed PDF-file into iframe fails.
http://code.google.com/p/chromium/issues/detail?id=162833

(No comment was entered for this change.)

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages