Display of PDFs in browsers

I have some PDFs embedded in my website with either @willwood ’s Embed or @joeworkman 's PDF Embed stacks. I just recently noticed that they don’t display properly after years of normal functioning. I have checked them in Safari, DuckDuckGo, Brave and Firefox.

In case of Will’s stack, they only display properly in Firefox and Brave (see the first screenshot). In other browsers the built-in PDF viewer does not display any controls.

In case of Joe's stack, none of them display at all – just show an error (but they do show controls 😛) – second screenshot:

Has anybody experienced similar behavior? Any remedy? Is it something in specific browser’s settings that needs to be changed?

What did you use to create the PDF? Open the PDF in Preview and print it to a new PDF. Then try with that one.

Thanks, Joe,

Originally, I created them in Apple Pages and printed them to PDF format. And like I said, they used to work fine for years. I am not sure when the problems started .

I will try your trick with Preview and will report back.

So, after I made the fresh PDF document same way as described above, results were exactly the same. The ‘Preview’ trick did not work.

The only difference was that when PDF Embed stack has been set to “Default Browser Viewer”, there was no controls on screen, whereas with ‘PDF Embed’ set to “PDF Embed Viewer”, controls were visible, but the document itself was blacked-out and there was the red warning – like in my previous attempts.

@joeworkman Joe, if you would be so kind to check this out, I could publish a demo page for you, because right now all my PDFs are secured with password (membership). Please, let me know.

Did you try to re-export your PDF?

Yes. While original PDF was opened in Preview, I tried both printing to PDF and exporting. Neither one worked after embedding in my page and republishing.

Is this on a published page that I can look at?

Yes, I’ve already sent you a PM with details.

The PDF viewer application does not seem to be published to where the stack is looking for it. Make sure that your website address is properly configured in the publishing and/or project settings. Then republish all files.

I double-checked that URLs of PDF files are correct. They are same for Will’s stack and for yours.

It’s not the URLs to the PDFs. It’s the internal linking from my stack to it’s PDF viewer that is published in rw_common.

1 Like

Sorry for the misunderstanding, Joe. Indeed, after I updated rw_common folder, all is good now. Thank you for your help!

To conclude, this test/exercise shows that your PDF Embed stack works better when it is set to “PDF Embed Viewer” rather than to “Default Browser Viewer” (in this last case the controls remained undisplayed in some browsers).


Hey, Joe,

Once I tried to use your PDF Embed stack in real-life website, I got another obstacle.

In that website, PDF documents are protected by Sitelok. Not only a viewer needs to be logged-in, but also for further security, PDFs are located in Sitelok’s special directory called slfiles_xxxxxxxxxxx that is accessed by php function, so that they can not be found by unauthorized people. In that case, the URL starts with
<?php if (function_exists

While Will’s stack has no problem with that, it seems to me that your stack does not resolve this kind of situation. Unless I am not setting your stack up the right way. Could you, please, comment on that? Sorry for additional bother.

Use my Visilok stack to only display the PDF Embed when a user is logged in.

The thing is, Sitelok password itself makes sure that user needs to be logged-in. I am talking about solution against finding the actual PDF file in the directory of my site. Visilok just repeats redundantly the same function as Sitelok’s password does, right?

What PHP are you adding to the URL? I am not a Sitelok expert…

I spoke to Adrian and he is interested in solving this together with you. Could you, please, contact him at his email address? In case you don’t have it, I will send it to you in PM.

So, Joe, is there any chance you could update your PDF Embed stack to work with URLs coded into a PHP function (like the one I’ve sent you via a PM message)? I can wait if you confirm that you will update it. 🙂

Hi Joe,

Just to explain what I think is required here. In Sitelok we can use _HP to generate a secured URL. I think the user would like to be able to enter something like

<?php siteloklink('testfile.pdf',0); ?>

instead of a traditional URL.Nothing needs to be done with that except to allow it even thoguh it doesn’t like an URL. Hope that makes sense.

1 Like