vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   BB Code Enhancements - BBCode: Embed PDF Files (No JavaScript/No iFrames) (BB Code) (https://vborg.vbsupport.ru/showthread.php?t=248549)

BirdOPrey5 08-12-2010 10:00 PM

BBCode: Embed PDF Files (No JavaScript/No iFrames) (BB Code)
 
1 Attachment(s)
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>

Example: [pdf]http://www.qapla.com/ju/PDFOpenParameters.pdf[/pdf]
(I suggest using your own example if possible.)
Use Option: No
Button Image: (optional) https://vborg.vbsupport.ru/attachmen...1&d=1281727232
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

stwan 08-13-2010 06:47 PM

After placing the pdf file - thread not scrolling (Mozilla 3.6.8)

BirdOPrey5 08-13-2010 07:43 PM

If the mouse pointer is over the PDF it may try and scroll the PDF and not the page, that would be 'normal' behavior when there's a 'window' inside a 'window' - try using the browser's "slide bar" at the right of the page or the arrow keys and see if you can get it to scroll...

Also, are you able to scroll the page on my demo site?

Can you give me a link to your site where I can see the problem?

abqtj 08-14-2010 02:33 AM

I have to click once, outside of the pdf window, to get the thread to scroll again.

That's using Chrome, btw

laebshade 08-14-2010 12:30 PM

That's normal behavior, abqtj.

Thanks for this, I'll try it out.

Michlerish 08-16-2010 07:33 AM

I clicked on the demo you provided, Adobe appeared to be starting up, then I got a popup that said:

box title: Acrobat Plug-In
text: This operation is not allowed
option to click: OK

I want to install this code, but not if that's going to happen to my pdfs ;) Any idea why that happened?

BirdOPrey5 08-16-2010 01:19 PM

I would guess there is something wrong with your pdf plugin, maybe an old version or maybe some option you chose when installing?

I would re-download the latest version from: http://www.adobe.com/products/reader/

Also what browser/OS were you using?

Michlerish 08-16-2010 09:26 PM

Firefox 3.5.11 / Windows XP

I'll try updating adobe reader.

markwein 08-17-2010 10:59 PM

not working for me...keeps looking for additional plug ins.

BirdOPrey5 08-17-2010 11:50 PM

Did you install the pdf plugin from: http://www.adobe.com/products/reader/

What browser/OS are you using?


All times are GMT. The time now is 12:27 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01202 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete