PDA

View Full Version : BB Code Enhancements - BBCode: Embed PDF Files (No JavaScript/No iFrames) (BB Code)


BirdOPrey5
08-12-2010, 10:00 PM
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 (http://www.adobe.com/products/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:

<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: http://www.qapla.com/ju/PDFOpenParameters.pdf
(I suggest using your own example if possible.)
Use Option: No
Button Image: (optional) https://vborg.vbsupport.ru/attachment.php?attachmentid=120783&stc=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 (https://vborg.vbsupport.ru/member.php?u=258922) for other BB Code enhancements. They work on all versions.

Screenshot Attached:
https://vborg.vbsupport.ru/attachment.php?attachmentid=120786&stc=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
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:
<embed src="{param}" type="application/pdf" width="700" height="900">
change it to this:
<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
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
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
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/showthread.php?1526-Shark-Pictures&p=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:


http://www.blackfinowners.com/forums/attachment.php?attachmentid=2031&d=1309265800


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

http://www.qapla.com/ju/PDFOpenParameters.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
Hi,

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

http://www.qapla.com/ju/PDFOpenParameters.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
Hy,

Me too

Please can you see the problem

Thank s

See my answer in post # 33.

Lewenhaupt
12-05-2011, 07:17 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.

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.

Lewenhaupt
12-08-2011, 02:10 PM
Already have, attachments still not working on chrome though.

BirdOPrey5
12-08-2011, 06:23 PM
Please try again because developers are able to see who has it marked and who doesn't, and it's not showing up for you.

As I requested before I need the exact code you are using that isn't working.

HDMI
03-05-2012, 10:07 AM
please try agin..

<object type="application/pdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" data="{param}" width="800" height="900"><param name="src" value="{param}"><embed src="{param}" width="800" height="900" /></object>

demo : http://www.reddulmuhtar.com/Forum/showthread.php?142-Eklenti-Denemeleri&p=188#post188

BirdOPrey5
03-05-2012, 10:21 AM
HDMI, I don't understand you post... "please try agin.." ???????

HDMI
03-05-2012, 11:09 AM
<object type="application/pdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" data="{param}" width="800" height="900"><param name="src" value="{param}"><embed src="{param}" width="800" height="900" /></object>

I meant to say ;
I recommend above code to enter instead of the code which is in the first message.
(For the version 4.1.11)
I hope this would be helpful.

Have a good work ...

BirdOPrey5
03-05-2012, 11:47 AM
Your code has a useless "classid" parameter... you should at least remove that from the code-

Your also missing the "type" from the <embed>


<object type="application/pdf" data="{param}" width="800" height="900">
<param name="src" value="{param}" />
<embed src="{param}" width="800" height="900" type="application/pdf" />
</object>


Not tested but that would be the appropriate code using both <object> and <embed>.

ricardoNJ
04-11-2012, 10:51 PM
Testing..........

Trevor Matthews
04-13-2012, 08:31 PM
I am using Firefox and 4.1.12, the mod is working just great except that I can only scroll the pdf, the thread will not scroll wherever I try and click on the page.

Is there anything I can do about this.

I went to your demo page but can only see a list of BB codes and not a pdf.

BirdOPrey5
04-13-2012, 11:28 PM
Fixed demo link- but there is no way to solve the scrolling issue. That's the same on all browsers.

Trevor Matthews
04-14-2012, 05:24 PM
Ok, thanks for letting me know.

lemonadesoda
04-15-2012, 03:43 PM
...the bbcode 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 - but not through inline "attachments".)

I have the same issue, hence my post a year ago https://vborg.vbsupport.ru/showpost.php?p=2140107&postcount=12

I have fixed it. How?

1./ Update to LATEST Acrobat Reader 10.1.3
2./ Update to latest Chrome
3./ Launch chrome
4./ In address bar type chrome://plugins
5./ Enable Acrobat Reader plugin (which will automatically disable Chrome PDF reader plugin)

Inline attachments should now work also within the bbcode as PDF inline read. There seems to be a bug in the embedded Chrome PDF reader that is not caching or cannot resolve the indirect link to the attachment PDF. This problem doesnt not occur with IE, and was a solution discovered by trial and error. No logic there!

Try it out and report back to see if this is a general solution, or just worked for me.

etca
04-15-2012, 08:19 PM
installed on 4.1.12

stl7997
09-30-2012, 04:43 PM
Is this working for anybody that has 4.2? I just get a empty gray box. I've tried Chrome, FF, and IE and it's all the same. Just curious.

BirdOPrey5
09-30-2012, 05:02 PM
Is this working for anybody that has 4.2? I just get a empty gray box. I've tried Chrome, FF, and IE and it's all the same. Just curious.

It should work... do you have a PDF reader installed on your computer/browser?

If you can post a link to a page with the problem.

stl7997
09-30-2012, 05:19 PM
I've got a PDF reader. Here's a link to one of the embeds.

http://forum.wapscalc.com/showthread.php?341-RAND-NCO-Promotion-Study

Snowhog
09-30-2012, 06:27 PM
BOP5@

Your demo doesn't work for me either - it seems to specifically want the Adobe plug-in. I'm running Kubuntu 12.04, 64-bit, with Okular version 0.15.1. Okular is an Adobe Reader compliant Linux .pdf viewer/reader.

BirdOPrey5
09-30-2012, 08:50 PM
I've got a PDF reader. Here's a link to one of the embeds.

http://forum.wapscalc.com/showthread.php?341-RAND-NCO-Promotion-Study

The file you are linking to does't exist:

http://forum.wapscalc.com/pdfs/NCOpromotion.pdf

check the spelling maybe... ?m

BirdOPrey5
09-30-2012, 08:52 PM
BOP5@

Your demo doesn't work for me either - it seems to specifically want the Adobe plug-in. I'm running Kubuntu 12.04, 64-bit, with Okular version 0.15.1. Okular is an Adobe Reader compliant Linux .pdf viewer/reader.

There's nothing in the code that can specify a specific PDF reader. It's simply your PDF viewer may not work embedded in web documents.

ikorolis
11-18-2012, 04:32 PM
thanks nice plug in but no working to my vb 4.2pl3 any browser testing

uninstalled

i see only one box with html code no pdf.

Mr_Running
11-18-2012, 05:28 PM
Works for me 4.2pl3 in Firefox 16 and IE9 :)

synseal
11-28-2012, 10:25 PM
Excellent as per usual.

Installed + rated 5.

Guest20210129
01-11-2013, 06:44 PM
Perfect.

Thanks (:

coolbreeze86
01-31-2013, 07:49 AM
hi.. great mod.. actually working correctly for the files uploaded but not working for the attachments made through vbulletin.

It just shows a grey area, when i tried to embed attached vbulletin pdf files. Help me.. what will be mistake..??

Digital Jedi
01-31-2013, 03:59 PM
hi.. great mod.. actually working correctly for the files uploaded but not working for the attachments made through vbulletin.

It just shows a grey area, when i tried to embed attached vbulletin pdf files. Help me.. what will be mistake..??
My guess would be because it's an attachment. Attachments have no extension, so it can't embed what's not ending in .pdf.

coolbreeze86
01-31-2013, 07:41 PM
Thanks for the reply..

in this post (https://vborg.vbsupport.ru/showpost.php?p=2140120&postcount=13) he mentioned that it will work for attachments.

my attachment url will be like this... "http://www.sitename.com/forums/attachments/xxxx-xxxx/58503d1358952797-photoshop-tutorial-2013.pdf"

coolbreeze86
02-01-2013, 10:39 AM
hey guyz please help me to embed attached files...

SiteTalkZone
03-15-2013, 01:00 AM
its working fine in forums but not working in article, it just showing a grey color in article (I'm not using an attachment)

mrschmitz
04-04-2013, 02:24 PM
It works fine in IE for me, but in Chrome it shows a grey box.

BirdOPrey5
04-09-2013, 01:09 PM
There's no trick to using attachments...

For me it's just

http://www.juot.net/forums/attachment.php?attachmentid=1379&stc=1&d=1365999997

(for example) and it works.

If it doesn't work for you it may be a server issue or the PDF program you have installed (I have Adobe Reader X)

As for the issue with it not showing in the CMS, please post a link I can see it happening.

coolbreeze86
04-09-2013, 07:46 PM
There's no trick to using attachments...

For me it's just

http://www.juot.net/forums/attachment.php?attachmentid=1379&stc=1&d=1365999997

(for example) and it works.

If it doesn't work for you it may be a server issue or the PDF program you have installed (I have Adobe Reader X)

As for the issue with it not showing in the CMS, please post a link I can see it happening.

working fine now. lemonadesoda's post (https://vborg.vbsupport.ru/showpost.php?p=2320365&postcount=51) helped me.

But i have a doubt, why it is working correctly when i try to attach it with direct pdf link, but not working correctly with vbulletin attachment file. Is there is any solution?

Bcoz, how can we tell and force members to enable adobe acrobate in chrome://plugins.

BirdOPrey5
04-13-2013, 06:10 PM
You can't force users to have or user any such plguins- you can just post advising them how to have the best experience on your site- it is up to them to comply.

kartheekb
04-17-2013, 11:01 AM
Does this works for 4.2?

Naijasite
04-22-2013, 11:06 PM
not working on 4.2.1 showing 404 error. but it work at the admincp

tommythejoat
06-11-2013, 09:10 PM
I wanted to provide a size option for the hack, so I added the use of the {option} for. a dimension. The problem is that I cannot figure out how to adjust the other dimension.

The options are to allow both dimensions with a separator or use a fixed ratio like height = 1.6 x width. I used to be able to do that in html, but I don't really remember how.

I tried using vb:math but that does not seem to work.

I seem to recall that I cannot parse the option, but I can parse the parameter. However, I cannot find the html references on how to do that.

Can anyone help?

BirdOPrey5
06-12-2013, 04:53 PM
There is no real way to control 2 dimensions with a simple BB Code. You would need to go to a full blown modification with php plugins to deal with that.

tommythejoat
06-13-2013, 01:08 AM
I was hoping there was some secret expert trick to provide

embed {parameter} width="{option}" height="8*{option}/5"

e24h
06-13-2013, 01:11 PM
That's normal behavior, abqtj.

Thanks for this, I'll try it out.

BirdOPrey5
06-19-2013, 03:17 PM
Attn: RazKaziRo from vBulletin.com
http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/3977252-pdf-files-view-on-vbulletin

Re:

https://vborg.vbsupport.ru/

1) Make sure you have a PDF Viewer plugin for your browser

2) If you do, there may be a mistake in the replacement code, copy it in again. You seem to be missing some code.

RazKaziRo
06-19-2013, 05:49 PM
Attn: RazKaziRo from vBulletin.com
http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/3977252-pdf-files-view-on-vbulletin

Re:

http://speedcap.net/sharing/files/8e/b5/8eb5058f6783da45d969db954d3e3e1c.png

1) Make sure you have a PDF Viewer plugin for your browser

2) If you do, there may be a mistake in the replacement code, copy it in again. You seem to be missing some code.

thanks for the help but i check 3 times for the code and download all pdf viewer there is and try from 3 different computers and 3 different browsers

any ideas?

BirdOPrey5
06-19-2013, 09:29 PM
And you put in a post, for example:

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

??

RazKaziRo
06-21-2013, 07:44 AM
And you put in a post, for example:

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

??

yes i put exactly like that

BirdOPrey5
06-21-2013, 09:40 AM
Then I don't know what to tell you, sorry. It works on dozens, maybe hundreds, of other VB forums.

You don't have any "Replacement Variables" setup that could be interfering, do you?

ar15dcm
06-23-2013, 11:43 AM
The document view when I use it is skewed to right and down. Also when the post I have it embedded in comes up the browser looses focuses and focus is controlled by the embedded .pdf window.

I used the adobe .pdf document that discusses the controls and switches when embedding .pdf files and one of the controls is

http://www.xxxxx.com$fitH

This is suppsed to fit the document wigth wise in the viewable window... not.

Snowhog
06-23-2013, 05:38 PM
Just added this BBCode and tested in Chromium Browser. Had to download Google Chrome .deb package, extract the contents and copy the libpdf.so file to /usr/lib/chromium-browser as Chromium doesn't have a .pdf plug-in (Google Chrome does). Restarted Chromium and went to your demo page and voila, embedded .pdf document! Just too cool. :cool: :cool:

Even though this MOD is from 2010, I've marked it as recommended for MOTM and of course, rated it Excellent. BOP5 continues to amaze me with his skills at providing improvements to vBulletin.

Digital Jedi
06-24-2013, 03:55 PM
thanks for the help but i check 3 times for the code and download all pdf viewer there is and try from 3 different computers and 3 different browsers

any ideas?

It really does look like there's an error in your HTML Replacement code. There's a dot where there should be a quotation mark. In addition, it almost looks like you have the code in there twice. Double check that you also don't have a plugin that automatically tries to parse PDFs installed.

RazKaziRo
06-27-2013, 10:55 AM
It really does look like there's an error in your HTML Replacement code. There's a dot where there should be a quotation mark. In addition, it almost looks like you have the code in there twice. Double check that you also don't have a plugin that automatically tries to parse PDFs installed.

i triple check it i copied the text exactly and follow the instructions
can you help me ?
i can give you admin premission for testing

thanks

Raz

BirdOPrey5
07-06-2013, 09:28 PM
Sorry guys... This is a simple bbcode, if it doesn't work I don't know why, it works on dozens of other sites.

There is nothing I can change in this mod to make it magically work on a site it doesn't work on now- the issue is external from this code.

I am marking this as unsupported because I do not have time to give the support some people are asking for.

I would suggest anyone having issues-
1) Try with a different browser
2) Make sire you have Adobe PDF Reader Plugin for your browser installed
3) Double/triple check the correct code in the BB Code Manager
4) Try from another computer

xtragic
08-18-2013, 05:44 PM
Sorry guys... This is a simple bbcode, if it doesn't work I don't know why, it works on dozens of other sites.

There is nothing I can change in this mod to make it magically work on a site it doesn't work on now- the issue is external from this code.

I am marking this as unsupported because I do not have time to give the support some people are asking for.

I would suggest anyone having issues-
1) Try with a different browser
2) Make sire you have Adobe PDF Reader Plugin for your browser installed
3) Double/triple check the correct code in the BB Code Manager
4) Try from another computer

Actually it doesn't work. I've tried this on my forums and know how to write xhtml, xml, PHP and LUA. I can only figure there has to be something in one of the VB updates that is preventing it from property embedding.

BirdOPrey5
08-22-2013, 10:33 AM
It works fine on my 3.8.7 and 4.2.1 forums.

Can you see the PDF on this page? http://www.qapla.com/mods/showthread.php/31-PDF-BBCode-Embedded-PDF

This is what it looks like to me (working):

https://vborg.vbsupport.ru/attachment.php?attachmentid=146139&stc=1&d=1377171151

xtragic
09-02-2013, 03:12 AM
After reinstalling it a second time, it now works on 4.1.11. Not sure why it wouldn't work the first time, unless I copied the code wrong. =/

kf4eok
09-20-2013, 08:10 PM
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/forum/showthread.php?69-test-pdf&p=128#post128

kf4eok
09-20-2013, 08:32 PM
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/forum/showthread.php?69-test-pdf&p=128#post128

I found what I was doing wrong. My link was incorrect.

john7911
10-12-2013, 06:32 PM
installed

thank you :)

good work :up:

blackberry
11-11-2013, 05:43 PM
how to make it work for mediafire
http://www.mediafire.com/view/d03dszi32mpa11h/Jannat_K_Pattay_Episode_10.pdf
??

Digital Jedi
11-13-2013, 07:20 PM
how to make it work for mediafire
http://www.mediafire.com/view/d03dszi32mpa11h/Jannat_K_Pattay_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.

blackberry
01-22-2014, 07:58 PM
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

kf4eok
01-28-2014, 12:42 PM
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 = http://www.baymeadowscommunitycouncil.net/pdf/visionplan.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

btedition
02-10-2014, 04:11 AM
Working with 4.2.0. Marked as installed, thanks!

tini_lam
09-28-2014, 12:18 PM
don't work with mediafire...

blind-eddie
03-18-2017, 08:14 PM
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?

Alan_SP
03-20-2017, 04:10 PM
Try pdf from https source. And check in browser if it blocked http scripts. And if it is, what happens if you allow them.

BirdOPrey5
03-22-2017, 09:21 AM
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.

Gn_Snake
03-22-2017, 10:18 AM
I confirm to me does not work. It worked perfectly before migration

BirdOPrey5
03-22-2017, 10:18 PM
Seems changing to an <object> tag instead of embed makes it work... There are some other small changes to the replacement 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>

blind-eddie
03-22-2017, 11:00 PM
Thanks Joe, What small changes?

blind-eddie
03-22-2017, 11:07 PM
Sorry Joe, http link still refuse to work for me.

BirdOPrey5
03-23-2017, 11:00 AM
Thanks Joe, What small changes?

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.

Sorry Joe, http link still refuse to work for me.

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.

Gn_Snake
03-24-2017, 02:53 PM
Thx BirdOPrey5, now it's ok!

Drucifer
04-19-2019, 06:51 PM
Is there a PDF Viewer in the works for vB v5?