I’m unable to add custom CSS to the viewer.php
file. Standard hooks like wp_head
, wp_footer
, and init
don’t work because this file is accessed directly via its file path. Could you provide a hook or method to apply custom CSS to this file?
Hi, even though I made the Hungarian translation for the plugin, it doesn’t work. I copied the files (.po and .mo) into the pdfjs-viewer-shortcode/languages ??folder, but it doesn’t work. I also tried the supported Spanish translation, but it doesn’t work either.
]]>Hi,
even if I change the text to be displayed in the “Fullscreen Link Text” setting in the plugin settings, if I paste the pdf short code into a post, the original English text is displayed: View Fullscreen
]]>Hello, we have a problem on safari (on the others browsers it’s fine):
The error: TypeError: undefined is not an object (evaluating ‘entry.borderBoxSize[0]’)
the line of the error: 2253 of pdf_viewer.js
Math.floor(entry.borderBoxSize[0].blockSize)
Perhaps you have a solution? make a callback? thanks in advance
]]>Hello, why is it not showing me the PDF? I have tried it with several PDFs and none of them are shown on the page, thank you
]]>Hi, Chrome browser on iOS mobile devices cannot display the contents of a PDF file.
I can’t go back to previous versions (it stops working at all), so I’m talking about the latest version of the plugin. It works without a problem on computers and Android phones. Please check if the problem only occurs with me and please help me solve the problem.
]]>Hi,
Upon updating, I am now finding that the Print and Save buttons are styled the same as the top bar, and thus have visually disappeared, despite functionality still being present.
Can you please look at this and update the plugin to address this?
Thank you!
]]>Hello,
Since version 2.18.1, I can no longer display the pdf files on my club’s website: see https://www.cyclosyennois.fr/category/guidolyenne/
I’ve tested successively with all PDF.js updates up to version 2.2.1 and the problem persists. I was able to reinstall version 2.18 and the pdf display works correctly.
Do you have any idea what’s wrong?
the site
Version wp 6.6.1
Thanks for your help
]]>PDF.js v2.6.347 (build: 3be9c65f)
Messaggio: file origin does not match viewer’s
same server two websites in one there is this error
]]>The PDF viewer is working for many of my users but some users are seeing a “gray screen” instead of the PDF file. I’ve asked them to update their browser. Some say that they have and are still getting the gray screen.
Is there something else that I can recommend. My biggest problem is that this a PUBLIC site and people will not come back if they receive a gray screen the first time around. They won’t report it either. So telling people to update their browsers isn’t helpful.
I do have the MJS MIME Type installed on my domain.
I look forward to your assistance.
Thank you
]]>Hi – can’t seem to get the targeting right to change the CSS so that the background is a lighter grey.
Tried: ” .pdfViewer:root {--body-bg-color: rgb(245 245 245)};
” and various permutations of same but none work.
Anyone got the correct CSS for this?
]]>Hi
How we can fix this issue
“Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “application/octet-stream”. Strict MIME type checking is enforced for module scripts per HTML spec.”
]]>Article: How to Install an Old Version of a WordPress Plugin
TLDR: Easiest Solution: Use the WP Rollback Plugin
]]>I’m using this plugin PDF.js Viewer to show PDF’s on the website frontend.
I’m also using Learndash Custom Tabs addon to show the PDF’s on my Lesson’s Custom tab.
I’m using the plugin’s shortcode in the custom tab field.
When saving the field it is showing the PDF correctly in the frontend but when editing the custom tab field it is showing the code below instead of the full shortcode.
If I save the lesson page again when it’s showing this code, it will remove the PDF from the frontend.
This issue started occurring about 6 months ago, before that is was working fine.
Any idea why this is happening and how to resolve this?
<div class="container-iframe"></div>
]]>
Hello, I’d appreciate if there were toggles for the following:
Thanks! (And also, I love that this plugin exists without mucking around or putting basic things behind paywalls like some other plugins do)
]]>If you just updated to PDFjs 2.2, and it’s no longer working, there’s a good chance your host needs to add support for JavaScript modules (mjs) files.
To do this, you can try one of the following.
AddType application/javascript .mjs
to your .htaccess file if you’re on an Apache server.mime-types.conf.hbs
file and update application/x-javascript js;
to application/x-javascript js mjs;
I’m sorry for the headaches this change is causing. Unfortunately, this plugin is just a wrapper for Mozilla’s PDFjs, and they started using mjs files, which means we have to too.
]]>It looks like there’s a major security vulnerability in PDF.js, which could well impact this plugin as well. Original reference: https://codeanlabs.com/blog/research/cve-2024-4367-arbitrary-js-execution-in-pdf-js/
It looks like version 4.2.67 onwards of PDF.js has fixed the vulnerability, so I think a new release of this PDF.js viewer plugin is needed to include that fix.
Hi, I’d like to add a HOME link at the top of the Full Screen View page. How could I do this? With CSS? A widget?
Thanks for any help,
Andre
]]>It has been a year since last update, and no support questions are being answered. Are any updates coming? Is this abandoned?
]]>Plugin just displays 403 error. Have tried a bunch of solutions including: blocking cache for uploads folders (where pdf is located); checking permissions on folders; put CDN in developer mode. All other PDF viewers using js work fine. Just like a couple of the features on this one so was going to give it a try. Sorry, can’t get it to work.
]]>I get this error:
PDF.js v1.9.426 (build: 2558a58d)
Messaggio: file origin does not match viewer’s
The PDF is in Media LIbary and URL is visible if I go directly there:
https://(my domain)/wp-content/uploads/2023/11/(my file name).pdf
This is the page: https://grantsbay.com/test-2/
Does anyone know why it isn’t working?
]]>I must not be searching using the right terms and hoping someone here can help. I run a buddypress site. On some social platforms I’ve been on, (librti.com being one of them), if I share a pdf url from anywhere, such as to a Mercola article, when I hit submit on my post, the pdf is automatically displayed to the user. I have not embedded it, used a shortcode to interpret it, nothing. The url to the pdf file was all I typed into my post and it displayed for other people to see.
I am trying to find a plugin that will do the same thing for the users of my buddypress site. When they share a url containing a pdf file, I want that file to be automatically loaded for other visitors to see. They should not need to use a shortcode or embed code. Just as wordpress can interpret other media files to view them automatically, I want this for pdf files.
I’m pretty sure there is a plugin out there that does this, but any searches bring back results telling the webmaster or blogger how to add pdfs and not telling the webmaster how to ensure front-end shared pdf urls can be automatically interpreted instead.
Help???
Here is how it looks when as a front-end user, I add a link to a post and what the post looks like after I’ve submitted it: https://www.dropbox.com/scl/fi/od1e9egow742m2c6ubtm2/autopdfviewrfrontend.jpg?rlkey=r0bcxyrvu6uku79cp681d7whr&dl=0
]]>Hello. Has anyone had success getting this plugin to resize on mobile? I’m working in Divi and so must use the shortcode. The sidebar (shows thumbnails and outline of PDF) is overlapping (partially covering) the PDF document. One solution would be to set the default display to completely toggle off the sidebar. Is there a way to do this?
]]>Nice plugin if I can get it to work correctly. I see this was an issue a couple of years ago. I am not sure if it is user error and I am missing something on my end.
I have a secure site and the plugin automatically enters http instead of https into the page code for the pdf links which of course does not open in the viewer.
The example code that the plugin rendered for the page above.
<!-- wp:pdfjsblock/pdfjs-embed {"imageURL":"https://www.wilkesgenealogy.com/wp-content/uploads/2023/09/Levi-Absher-Ledger.pdf","imgID":2025,"imgTitle":"Levi Absher Ledger"} -->
<div class="wp-block-pdfjsblock-pdfjs-embed pdfjs-wrapper">[pdfjs-viewer attachment_id=2025 url=https://www.wilkesgenealogy.com/wp-content/uploads/2023/09/Levi-Absher-Ledger.pdf viewer_width=0 viewer_height=800 url=https://www.wilkesgenealogy.com/wp-content/uploads/2023/09/Levi-Absher-Ledger.pdf download=true print=true fullscreen=true fullscreen_target=true fullscreen_text="View Fullscreen" zoom=auto ]</div>
<!-- /wp:pdfjsblock/pdfjs-embed -->
<gwmw style="display:none;"></gwmw>
Without sifting through the plugin code, am I missing some front-end switch and if not, do you know where I can change this to render it to write https so I don’t have to manually change the code on the WP page?
That would be a PITA for hundreds of files ??
Thank you.
]]>HI.. Great plugin to use instead of Scribd or Issuu but I cannot change the “View Fullscreen” text.. I change it in settings, save but nothing change, idem if I deselect the option “Show Fullscreen Link”, It remains the same..
WP 6.3.1 – PHP 8.1 – Theme Twenty Twelve 4.0
]]>Good day, dear plugin developer. Button “Add PDF” does not work in a text editor. I press it in the text editor and nothing happens. At the same time, the shortcode works normally. What am I doing wrong? Help please?!
]]>hello,
I would like to add a space between “view fullscreen” and the table, how can i do this ?
thanks for your answers
]]>Is it possible to use CSS to hide toolbar and stuff, to show only the PDF (like a super fullscreen mode embed), or change colors of toolbar, viewer, etc…
]]>I made a pdf file and does not want to let people copy the text so I protected the pdf file using password protection. after that I embed the pdf file in the website using your plugin but when I open the URL the text of the protected file can be copied. Although, the text of the pdf file on my computer cannot be copied.
]]>