Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
BBCode: Embed PDF Files (No JavaScript/No iFrames) (BB Code) Details »
BBCode: Embed PDF Files (No JavaScript/No iFrames) (BB Code)
Mod Version: 1.00, by BirdOPrey5 (IB Staff) BirdOPrey5 is offline
Developer Last Online: Mar 2021 I like it Show Printable Version Email this Page

vB Version: 4.0.x Rating: (14 votes - 5.00 average) Installs: 142
Released: 13 Aug 2010 Last Update: Never Downloads: 0
Not Supported Re-usable Code Translations  

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Example: [pdf]http://www.qapla.com/ju/PDFOpenParameters.pdf[/pdf]
(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:
http://www.vbulletin.org/forum/attac...1&d=1281727562

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
BB Code Enhancements ZippyShare.com shared music BBCode (Embed MP3 files in your forum!) BirdOPrey5 vBulletin 3.8 Add-ons 6 16 Jul 2013 23:44
BB Code Enhancements BBCode: Embed PDF Files (No JavaScript/No iFrames) (BB Code) BirdOPrey5 vBulletin 3.8 Add-ons 23 27 May 2012 17:28
BB Code Enhancements ZippyShare.com shared music BBCode (Embed mp3 files in you forum!) BirdOPrey5 vBulletin 4.x Add-ons 11 01 Sep 2011 11:47
BB Code Enhancements [BB Code] YouTube Javascript Embed wii vBulletin 3.8 Add-ons 21 10 May 2011 09:28
BB Code Enhancements [BB Code] YouTube Javascript Embed wii Modification Graveyard 36 13 May 2008 09:10

  #91  
Old 20 Sep 2013, 21:10
kf4eok's Avatar
kf4eok kf4eok is offline
 
Join Date: Sep 2009
Real name: Daniel
When I use this bb code it will work in the test block below bb code manager but it doesn't work in a post. I get a black block.
Also the Click here to view or download the file directly dose not work.

any ideas of what I could be doing wrong?
I am running 4.2
Here is my post link:
http://www.gonejetskifishing.com/for...&p=128#post128

Last edited by kf4eok; 20 Sep 2013 at 21:25.
Reply With Quote
  #92  
Old 20 Sep 2013, 21:32
kf4eok's Avatar
kf4eok kf4eok is offline
 
Join Date: Sep 2009
Real name: Daniel
Originally Posted by kf4eok View Post
When I use this bb code it will work in the test block below bb code manager but it doesn't work in a post. I get a black block.
Also the Click here to view or download the file directly dose not work.

any ideas of what I could be doing wrong?
I am running 4.2
Here is my post link:
http://www.gonejetskifishing.com/for...&p=128#post128
I found what I was doing wrong. My link was incorrect.
Reply With Quote
  #93  
Old 12 Oct 2013, 19:32
john7911 john7911 is offline
 
Join Date: Feb 2013
installed

thank you

good work
Reply With Quote
  #94  
Old 11 Nov 2013, 17:43
blackberry's Avatar
blackberry blackberry is offline
 
Join Date: Feb 2008
Real name: Sheem
how to make it work for mediafire
http://www.mediafire.com/view/d03dsz...Episode_10.pdf
??
__________________
SachiiDosti - Hum Sub Dost Hain
Reply With Quote
  #95  
Old 13 Nov 2013, 19:20
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Real name: Mark Daniel Martinez
Originally Posted by blackberry View Post
how to make it work for mediafire
http://www.mediafire.com/view/d03dsz...Episode_10.pdf
??
Unless you have a direct link to the PDF file, you can't. The embed code is looking for an actual PDF file. Not a web page URL that happens to end in .pdf, but instead has a PDF embeded in it.
__________________
Reply With Quote
  #96  
Old 22 Jan 2014, 19:58
blackberry's Avatar
blackberry blackberry is offline
 
Join Date: Feb 2008
Real name: Sheem
Originally Posted by Digital Jedi View Post
Unless you have a direct link to the PDF file, you can't. The embed code is looking for an actual PDF file. Not a web page URL that happens to end in .pdf, but instead has a PDF embeded in it.
never mind, i figure out how to do for box.com
__________________
SachiiDosti - Hum Sub Dost Hain

Last edited by blackberry; 22 Jan 2014 at 20:36.
Reply With Quote
  #97  
Old 28 Jan 2014, 12:42
kf4eok's Avatar
kf4eok kf4eok is offline
 
Join Date: Sep 2009
Real name: Daniel
Thumbs up pdf bbcode for Internet Explorer users

I have changed the bbcode so that users that see a blank pdf will have a link to click to view the file.

-----IF THE PDF IS BLANK CLICK HERE TO VIEW.-----

~~ok my bbcode settings are now as below:
----------------------------------------------------------------------------------------------------------------------
Title = embed_pdf
BB Code Tag Name = pdf
Replacement =
<div align="center">
<p align="center">
<p><a href="{param}">---------------IF THE PDF IS BLANK CLICK HERE TO VIEW.--------------- </a></p>
<br />
<object type="application/pdf" data="{param}" width="800" height="900">
<param name="src" value="{param}" />
<embed src="{param}" type="application/pdf" width="800" height="900">
<p><a href="{param}">Click here to view or download the file directly.</a></p>
</object><br />
</embed>
</p></div>


Example = [pdf]http://www.baymeadowscommunitycouncil.net/pdf/visionplan.pdf[/pdf]
Description = Allows you to embed a pdf file.
Use {option} = Yes


Remove Tag If Empty = Yes
Disable BB Code Within This BB Code = Yes
Disable Smilies Within This BB Code = Yes

Disable Word Wrapping Within This BB Code = Yes
Disable Automatic Link Parsing Within This BB Code = Yes
----------------------------------------------------------------------------------------------------------------------

This seems to work for now until a better solution is found.
Anyone that sees a problem with this please let me know and show me a better way of doing this.
Thanks
Reply With Quote
  #98  
Old 10 Feb 2014, 04:11
btedition btedition is offline
 
Join Date: Jun 2012
Working with 4.2.0. Marked as installed, thanks!
Reply With Quote
  #99  
Old 28 Sep 2014, 13:18
tini_lam tini_lam is offline
 
Join Date: Dec 2009
don't work with mediafire...
Reply With Quote
  #100  
Old 18 Mar 2017, 21:14
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Real name: Tim
Hey Joe, your pfd bbcode was working great on a vb4 site before it was changed to https.
Any idea what would cause it to stop functioning?
The acp is not https and the pdf bbcode example works fine there, thoughts?
__________________
LONG LIVE 3.8 SERIES
National Arcade Competition Club- NACC All arcade edits will work on vb4.
Check out my heavily modified ibproarcade with over 50,000 games for you, free of charge!
Exclusive arcade addons, edits and skins were made by stangger5 owner of Next Level Arcade
Reply With Quote
  #101  
Old 20 Mar 2017, 17:10
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
Try pdf from https source. And check in browser if it blocked http scripts. And if it is, what happens if you allow them.
Reply With Quote
  #102  
Old 22 Mar 2017, 10:21
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
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.
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #103  
Old 22 Mar 2017, 11:18
Gn_Snake Gn_Snake is offline
 
Join Date: Feb 2006
I confirm to me does not work. It worked perfectly before migration
Reply With Quote
  #104  
Old 22 Mar 2017, 23:18
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Seems changing to an <object> tag instead of embed makes it work... There are some other small changes to the replacement code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #105  
Old 23 Mar 2017, 00:00
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Real name: Tim
Thanks Joe, What small changes?
__________________
LONG LIVE 3.8 SERIES
National Arcade Competition Club- NACC All arcade edits will work on vb4.
Check out my heavily modified ibproarcade with over 50,000 games for you, free of charge!
Exclusive arcade addons, edits and skins were made by stangger5 owner of Next Level Arcade
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 19:29.

Layout Options | Width: Wide Color: