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?

Dr.osamA 12-28-2010 12:49 PM

installed

thank you bro

good work

lemonadesoda 12-28-2010 01:21 PM

How would I use this BBcode for a PDF file that I have uploaded myself into vB? ie via the paperclip file attachment in a post.

Some PDFs are confidential and I dont want to just upload them into public.html/root/folder, but keep them in the attachments manager that deals with access rights, etc.

PS. I store attachments in the filesystem not the database (if it makes a difference).

BirdOPrey5 12-28-2010 01:43 PM

If you right click on the link to your attached file and get the URL to said file, then put that URL between the PDF BB Code tags, that should work.

hoatran 02-22-2011 03:22 PM

Great job mate, Working well on mine. thankssss

giaguaro 03-12-2011 12:56 PM

great job, installed and working!

l3asturd 03-14-2011 12:13 AM

Do you have any idea if there's a way to just show the PDF only and the the Adobe Reader frame around it? I'm trying to use it to show miniature PDF's but when I shrink it down the only thing I see is the adobe reader frame.

Is my question clear? If not I'll post some images of before and after. Thanks.

l3asturd 03-14-2011 12:19 AM

Quote:

Originally Posted by l3asturd (Post 2173067)
Do you have any idea if there's a way to just show the PDF only and the the Adobe Reader frame around it? I'm trying to use it to show miniature PDF's but when I shrink it down the only thing I see is the adobe reader frame.

Is my question clear? If not I'll post some images of before and after. Thanks.

I just solved my own question but I thought I'd post the solution here in case anyone wanted to get rid of the adobe toolbar,navpanes, and scrollbar:

Instead of this:
Code:

<embed src="{param}" type="application/pdf" width="700" height="900">
change it to this:
Code:

<embed src="{param}#toolbar=0&navpanes=0&scrollbar=0" type="application/pdf" width="700" height="900">

giaguaro 03-15-2011 07:51 PM

strangest thing is i havent any menu from Adobe and i use the standard mod..

BirdOPrey5 03-16-2011 12:10 AM

I'd imagine the menu depends on the version of adobe reader you have installed. (Or maybe it's not even adobe reader, this would work with other pdf viewers besides adobe that work with your web browser.)

stwan 04-08-2011 08:48 AM

<a href="https://support.mozilla.com/ru/questions/806638" target="_blank">https://support.mozilla.com/ru/questions/806638</a>

jkanellopoylos 05-19-2011 10:01 AM

It doesnt work.

http://img828.imageshack.us/img828/3489/pdf1u.jpg

and when i click at link

http://img98.imageshack.us/img98/3510/pdf2.jpg

BirdOPrey5 05-19-2011 02:36 PM

Looks like something might be wrong with the replacement code you copied.

Also could be an error in the URL you specified between the [pdf] tags.

I suggest deleting the code and trying again.

DNN 05-27-2011 12:04 AM

That is a good mod for making e-books and offering free downloads, for SEO

raznaran 06-28-2011 12:15 PM

Could you expound on the install for us "non coders". Where do you put this code? Do you have to add it for every pdf or just once ? Sorry. Realize it's probably a dumb question but I need help.

BirdOPrey5 06-28-2011 12:31 PM

Quote:

Originally Posted by raznaran (Post 2214029)
Could you expound on the install for us "non coders". Where do you put this code? Do you have to add it for every pdf or just once ? Sorry. Realize it's probably a dumb question but I need help.

In your Admin Control Panel (Admin CP) scroll down the menu and choose "Add a New BB Code" then follow the instructions in the first post.

You will copy all of the info in the first post to the corresponding box in the "Ass a New BB Code" page.

When done hit SAVE and the BB Code will be active.

raznaran 06-28-2011 02:51 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2214039)
In your Admin Control Panel (Admin CP) scroll down the menu and choose "Add a New BB Code" then follow the instructions in the first post.

You will copy all of the info in the first post to the corresponding box in the "Ass a New BB Code" page.

When done hit SAVE and the BB Code will be active.

THanks ! Appreciate it. I've done everything but it's not working. I suspect that my "example" is screwed up. I replaced your url with my url but I wasn't sure about the "ju" so I put in forums. I guess that wasn't right.

My url is www.blackfinowners.com. What would I add instead of "ju" ?

Thanks.

BirdOPrey5 06-28-2011 03:11 PM

You can use the exact example... qapla.com is hosting a test PDF file.

If you want to use your own example you will first have to upload a pdf file to your server and put the full address to it in the example perhaps something like:

http://www.blackfinowners.com/pdf/testpdf.pdf

"ju" is just the directory on my qapla.com domain where this particular test pdf is located.

raznaran 06-28-2011 03:59 PM

Everything seems installed fine. The preview pix on the acp look correct.

Will this thing work retroactively? What I mean is will .pdf attachments previously uploaded be displayed ?

If the answer is yes, then I guess It's not working correctly for me.

BirdOPrey5 06-28-2011 04:20 PM

It is a BB Code- it will work wherever the bbcode was entered correctly, before or after it was installed.

Can you post here whatever you have in one of your posts that isn't working.

raznaran 06-28-2011 04:39 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2214133)
It is a BB Code- it will work wherever the bbcode was entered correctly, before or after it was installed.

Can you post here whatever you have in one of your posts that isn't working.

Thank you for persevering with me ! Look at the following link and you will see what I am talking about.

http://www.blackfinowners.com/forums...=8990#post8990

BirdOPrey5 06-28-2011 04:59 PM

Simply attaching a PDF file to a post isn't going to make it appear on the page.

You need to put the URL to the attachment inside the PDF tag.

Like this:

Code:

[pdf]http://www.blackfinowners.com/forums/attachment.php?attachmentid=2031&d=1309265800[/pdf]
For this to work whoever is viewing it also has to have permission to view attachments on your site.

nrasheed 10-25-2011 03:39 PM

Hi,

I am using it with VB4.1.7 I followed you instruction but after I post, it just shows me

[pdf]http://www.qapla.com/ju/PDFOpenParameters.pdf[/pdf]

instead of the windowed PDF document...

Any suggestion.....

Appreciations....

BirdOPrey5 10-26-2011 01:01 AM

That would mean you either didn't set the field BB Code Tag Name: correctly- it should just be pdf

Or you set "Use Option" to "Yes", it must be set to "No."

nrasheed 10-26-2011 01:57 AM

Thanks, it was "Use Option" ....

misericorde 10-31-2011 12:54 AM

Quote:

Originally Posted by nrasheed (Post 2261458)
Hi,

I am using it with VB4.1.7 I followed you instruction but after I post, it just shows me

[pdf]http://www.qapla.com/ju/PDFOpenParameters.pdf[/pdf]

instead of the windowed PDF document...

Any suggestion.....

Appreciations....

Hy,

Me too

Please can you see the problem

Thank s

BirdOPrey5 10-31-2011 11:42 AM

Quote:

Originally Posted by misericorde (Post 2263032)
Hy,

Me too

Please can you see the problem

Thank s

See my answer in post # 33.

Lewenhaupt 12-05-2011 07:17 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2140120)
If you right click on the link to your attached file and get the URL to said file, then put that URL between the PDF BB Code tags, that should work.

Doesn't work. Instead I get a grey area where the PDF should appear.

BirdOPrey5 12-06-2011 07:40 PM

Please post the bbcode you are using, exactly, here. (the path to the pdf)

Lewenhaupt 12-07-2011 10:15 AM

My apologies, the bbcode is correct and appears to be working perfectly in firefox. But I switched to chrome a while ago, and there the attachments won't show up.

edit:
PDF files that are hosted on the site - uploaded to a folder through ftp - do work on chrome.

BirdOPrey5 12-07-2011 11:17 PM

Thanks for the update. Please mark this mod as installed if you are using it.


All times are GMT. The time now is 05:24 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.01531 seconds
  • Memory Usage 1,820KB
  • 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
  • (4)bbcode_code_printable
  • (7)bbcode_quote_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
  • (40)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