The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
BBCode: Embed PDF Files (No JavaScript/No iFrames) (BB Code) Details »» | |||||||||||||||||||||||||||
BBCode: Embed PDF Files (No JavaScript/No iFrames) (BB Code)
Developer Last Online: Aug 2023
This is <embed> BB Code to embed a PDF file into your forum. The user needs a compatible PDF Reader such as Adobe's free PDF Reader. If they don't have one they will still see a link to view the PDF directly.
I am aware <embed> is not "proper" HTML but it works fine in all major browsers (IE/FF/Chrome/Opera/Safari) while <object> was not working for me in IE. If you prefer to keep to strict HTML guidelines and don't care about IE users then simply change the two instances of "embed" in the replacement code to "object". This has been confirmed working in the latest releases of IE, FF, Chrome, Safari, and Opera. I am also aware there are at least 2 other PDF BB Codes out there... I believe this implementation is better because one of them uses JavaScript and another uses an iFrame and relies on a 3rd party website (google) to display the PDF. My implementation uses no JavaScript and does not reply on any other websites. Demo: http://www.juot.net/forums/showthread.php?t=46803 Add a new BBCode Title: Embed PDF BB Code Tag Name: pdf Replacement: Code:
<div align="center"> <p align="center"> <embed src="{param}" type="application/pdf" width="700" height="900"> <br /> <a href="{param}">Click here to view or download the file directly.</a> <br /> </embed> </p></div> (I suggest using your own example if possible.) Use Option: No Button Image: (optional) Remove Tag If Empty: Yes All Disable Options: Yes Overall this tag acts a lot like the built in [img] tags. Please mark as installed if you use this. Check My Profile for other BB Code enhancements. They work on all versions. Screenshot Attached: https://vborg.vbsupport.ru/attachmen...1&d=1281727562 Show Your Support
|
4 благодарности(ей) от: | ||
ITDarasgah, Judith2, synseal, Toorak Times |
Comments |
#102
|
||||
|
||||
Try pdf from https source. And check in browser if it blocked http scripts. And if it is, what happens if you allow them.
|
Благодарность от: | ||
blind-eddie |
#103
|
||||
|
||||
Weird, but confirmed same issue on my own site. I guess browsers just don't trust pdf files, even if loaded over https. I suppose its because these days PDF files can submit data on their own outside of the security of the rest of the page it is loaded on. I haven't checked yet for any fix, too many other things to deal with on the https conversion. But if I find a fix I'll post it.
|
Благодарность от: | ||
blind-eddie |
#104
|
|||
|
|||
I confirm to me does not work. It worked perfectly before migration
|
Благодарность от: | ||
blind-eddie |
#105
|
||||
|
||||
Seems changing to an <object> tag instead of embed makes it work... There are some other small changes to the replacement code:
Code:
<div align="center"> <p align="center"> <object data="{param}" type="application/pdf" style="width:700px; height:900px;"> <br /> <a href="{param}">Click here to view or download the file directly.</a> <br /> </object> </p></div> |
#106
|
||||
|
||||
Thanks Joe, What small changes?
|
#107
|
||||
|
||||
Sorry Joe, http link still refuse to work for me.
|
#108
|
||||
|
||||
You can compare it to the one in the original post, I didn't change it. Things like width and height specified as CSS now.
All I can say is it works for me. PDF file is also on my own https server. sure it won't show if loaded from http link. Make sure you edit the post so it rebuild the cache if you didn't make a new post or truncate the postparsed table. |
#109
|
|||
|
|||
Thx BirdOPrey5, now it's ok!
|
Благодарность от: | ||
BirdOPrey5 |
#110
|
||||
|
||||
Is there a PDF Viewer in the works for vB v5?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|