PDF viewer iframe fails to load in Internet Explorer 6

I’m trying to embed a PDF document using Google’s document viewer in an iframe, but it’s not working properly in IE6. The iframe shows up empty with no content.

Here’s my current code:

<?php
$document_url = "http://www.example.com/files/report_2023.pdf";
$encoded_url = urlencode($document_url);
?>
<iframe frameborder="0" src="https://docs.google.com/viewer?url=<?php echo $encoded_url; ?>&embedded=true" width="600" height="400"></iframe>

The PDF loads fine in modern browsers, but Internet Explorer 6 just displays a blank iframe. I need to find a way to make this work with IE6 or find an alternative solution for displaying PDF files in older browsers. Has anyone encountered this issue before? What would be the best approach to handle PDF viewing compatibility with legacy IE versions?

IE6 doesn’t support Google’s viewer service at all. I ran into this on an old corporate intranet where we had to keep IE6 working. My solution? Set up a fallback using Adobe’s PDF plugin detection. Use JavaScript to check if they’ve got Adobe Reader installed, then embed the PDF directly with object and embed tags as backup. No plugin detected? Send them to a download page. This worked great for our IE6 users. The trick is graceful degradation - don’t try to force modern solutions on browsers that can’t handle them.

Google’s document viewer won’t work with IE6 - that browser just can’t handle modern web tech. I hit this same issue years ago on a legacy system. My fix was detecting IE6 and showing a direct download link instead of trying to embed the PDF. Use server-side browser detection to serve different content. For IE6 users, I just showed “Click here to download and view the PDF” with a direct link. Way more reliable than forcing PDF viewing in that ancient browser. You could also convert PDFs to JPG previews server-side, but that adds complexity and server load.

yea, IE6 is a pain… I had to handle it too. direct links are def the way to go. embedding won’t work well, so just give em direct download options. easier for everyone, trust me.