BB code for PDF Attachment

Get help developing custom BBCodes or request one.
Post Reply
User avatar
LuigiMdg
Registered User
Posts: 136
Joined: Sat Jan 10, 2015 9:12 pm
Contact:

BB code for PDF Attachment

Post by LuigiMdg » Mon May 21, 2018 12:18 am

Hi..
I've added the code for PDF viewer in text editor, but it for just for external PDF..
I can edit this to work also with attachments?

Now the BB code is:

Code: Select all

[pdf]{RELATIVE_URL}[/pdf]
And the code is:

Code: Select all

<iframe src="http://docs.google.com/gview?url={RELATIVE_URL}&embedded=true" style="width:100%; height:500px;" frameborder="0"></iframe>

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 2801
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: BB code for PDF Attachment

Post by thecoalman » Mon May 21, 2018 12:45 am

Edit- removed original answer as I misinterpreted your question.

---------------------------------------------------------

That Ifrrame is is going to be loading Javascript. It could be adopted for PDF's attachments on your own forum but you would need the Javascipt loaded for it to function.

User avatar
jan_2017
Registered User
Posts: 143
Joined: Sun May 07, 2017 3:39 pm

Re: BB code for PDF Attachment

Post by jan_2017 » Wed May 23, 2018 9:06 am

I see source code only instead the content.
Screenshot_20180523-110534.png
no pdf Preview :(

User avatar
Puchahawa
Registered User
Posts: 768
Joined: Sat Jan 01, 2011 10:33 pm
Name: Randy

Re: BB code for PDF Attachment

Post by Puchahawa » Wed May 23, 2018 5:21 pm

I've used this with good success. Basically same as above but minor change (URL vs relative URL). Height and width can be adjusted to your preference. Just need FULL URL of the pdf file down to .pdf. :)

BBCode usage

Code: Select all

[pdf]{URL}[/pdf]
HTML replacement

Code: Select all

<iframe src="{URL}" style="width:725px; height:800px;" frameborder="0"></iframe>
If this doesn't work for you, you may want to try this extension. It's one of Dmzx's that allows you to upload the file and gives you a direct link to it that you would put into the bbcode. I used that and it works well. Requires a minor edit to allow the pdf file. see 2nd and 3rd posts that topic.
Avatar courtesy of artist Faith Coyotë

User avatar
jan_2017
Registered User
Posts: 143
Joined: Sun May 07, 2017 3:39 pm

Re: BB code for PDF Attachment

Post by jan_2017 » Wed May 23, 2018 7:36 pm

Very Thanks.

It works :D

Thank you for code !

Bye Jan

User avatar
LuigiMdg
Registered User
Posts: 136
Joined: Sat Jan 10, 2015 9:12 pm
Contact:

Re: BB code for PDF Attachment

Post by LuigiMdg » Fri Jun 15, 2018 10:30 am

With your code, if you have http you have problem with https.. And if is https you have problem with http.. With Google you can use http or https and include all type, http and https ;)

Post Reply

Return to “Custom BBCode Development and Requests”

Who is online

Users browsing this forum: No registered users and 10 guests