Jump to content
Sign in to follow this  

Object tag doesn't display PDF

Recommended Posts

This is strange but recently my page stopped displaying PDFs using the object tag.  Nothing has changed on the page (in fact, I haven't worked with it in a very long time and there's no one else besides my supervisor who can edit it; I'm 99.99999% sure he hasn't touched it either).  I guess what I want to ask is if there's anything that looks out of place with my code:

$x = 0;
foreach ($arrPDF as $pdf) {
	echo "<object id='bulletin".$x."' data='../path/".$pdf."' type='application/pdf'>\n";
		echo "<span class='error'>Error: Could not load PDF.  Your browser does not support embedded objects.</span>\n";
	echo "</object>\n";

This code used to work, then just seemingly at random one day, it decided not to.  Used to display the PDFs, now I just get the error message.

Any suggestions?  I've already tried updating the browser.  I've tried it in FireFox, Chrome, and Edge.  None of them display the PDFs.  Everything I've seen online about the <object> tag suggests this code should be just fine.  Is there a different/better way to embed a PDF that I'm not finding?

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...