Pdf files not embedded when using Live Link

What issue or error are you experiencing?

I have a site where I have included some pdf files from media, and they display as embedded. (see attached).

But when I try to use Live Link to show the site to someone else there is just a blank space where the pdf file should be.

Is this a bug, or expected behaviour?

Thanks, Glenn

Hi @GlennFulford

Do you see any errors in the console if you open up your browser dev tools?

It could simply be caching related so you could try loading in a different browser or incognito window. You could check if you have plugins or themes that hold on to cache or have a “regenerate CSS” option. There could be other issues at play like mixed content that needs to have a URL search and replace done.

I’m not certain if PDF files normally are viewable in an embed. So much so that I wrote a plugin for it Embed PDF Viewer.

1 Like

No, there is no need for a plugin. Just upload the pdf to a page using the block editor automatically embeds it.

Good idea to try different browsers. Safari gave the same bhaviour as Chrome. Firefox was different, it just gave the links,

This behaviour is only with Live Link. When I upload pdf files into a wordpress site hosted on AWS Lightsale the bhaviour the pdf files are embedded as per normal.

Not sure about cache behaviour. I wioll try it on a new local site with no plugins.

But it looks to me more like a bug with Live Link…

Thanks, Glenn

Of course, your plugin might offer additional display options. I might give it a try to see if there is still the same display problem when I use the Live Link feature in
Local by FireWire.

@GlennFulford

If you open up your console when viewing a page like the ones above do you see any messages about mixed content or other errors populating?

1 Like

Hi @GlennFulford! :wave:

Are you by chance using a Page Builder for this project? Something like Elementor, Divi, etc?

Sometimes there are issues with images and the way things display generally over Live Links with Elementor and other similar builders.

There are some suggestions in this thread I would recommend trying:

Let me know if anything in there helps, we’ll get this figured out!

Sam

Hello Sam, no I am not using a page builder like Elementor, I
I am just using the standard Block Editor ( which I prefer, anyway).

Hello Nick, can you explain what you mean by opening up the consol. Do you mean the console tab in the Developer tools menu? Or the console tab in the Developer menu in chrome for the live site. In the latter I am getting a mixed content error, something about https and an insecure plugin resource.

I think that might explain it.

Thanks, Glenn

That’s exactly what I was referring to. If there are mixed content/insecure errors that could be part of the problem. So you could try taking some extra steps to clear those things up.

Live Links don’t match your Local Site URL (ie: mysite.local), so Local attempts to rewrite these on the fly. Live Links is broadly compatible with many themes, plugins, and custom code snippets. However, some images, front-end assets, or other HTML elements may be missing from your site when viewing it over Live Links.

As a first step you can try running a search and replace command to help clean up any mixed content type errors. To do this you can simply click on Open Site Shell in your Local app under your site name. The command would look something like this:

wp search-replace 'SITEURL' 'LOCALURL' --skip-columns=guid

As a tip you would:

You’ll also want to make sure you Trust Local’s SSL certificate, to help avoid insecure content as well.

There may be other plugins getting in the way as well if they are trying to force SSL/HTTPS.

1 Like

I have the exact same problem as @GlennFulford
I used elementor, adding an HTML code: <embed src="http://wordpress.local/wp-content/uploads/2024/03/File_name.pdf" type="application/pdf" width="100%" height="600"></embed>

I checked the links to pdfs in Inspects.
CSS Print Method is set to External CSS
Tried the Live link in Chrome, Edge, Brave, Opera. All missing the pdfs previews

Please help…

Hi @000000

Have you tried any cache troubleshooting? Regenerating Elementor CSS, flushing browser cache, using an incognito window or cache busting string?

Do you see any errors in your dev console?