Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github's electron doesn't allow embed tags?

Is there some sort of restriction? The console doesn't show any errors.

I am attempting to display a pdf using basic embed tags:

<embed src="./someFile.pdf" width="500" height="375" type='application/pdf'>

but my electron application shows:

enter image description here

like image 453
Charles Watson Avatar asked Apr 22 '26 10:04

Charles Watson


1 Answers

Electron uses Chromium under the hood and I don't believe Chromium is bundled with a PDF viewer plugin like Chrome is. You would need to recompile Electron with the proper plugins. There are also some Javascript PDF viewers out there you may want to look into.

PDF.js appears to be a solid choice and indeed another Electron user appears to be using it to solve your exact problem :)

Good luck!

like image 108
Chev Avatar answered Apr 25 '26 01:04

Chev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!