mo5bzn Publish time 2014-06-05 00:03

Show PDF Files Directly in the Thread

Edited by mo5bzn at 2014-6-4 23:38

In this thread I'll show how to add a pdf file directrly in the thread.
First go to AdminCP>Styles>Editor Settings>BB Code
Add a new field named as pdf.



Then click on Details and add information :
Tag(s):
pdf
Replacement content:
<p align="center">
<iframe src="{1}" style="width: 100%; height: {2}px;" frameborder="0"></iframe></p>
Example:
pdf-url-here
Explanation:
Add pdf file directly in the thread
Number of parameters:
2
Parameter prompt:
File URL
File height

Now the bb code is added; so when creating a thread, file url and file height have to be added :
file url : is simply the url of a pdf file
file height : despite the width which is fixed to 100% that means it perfectly fit to the editor's width, the height of the file must be typed, a 800px height is perfect to fit the whole pdf page, and if < 800px you have to scroll up and down to browse the file. Note that no need to type px after the typed height, it's just mentioned to avoid any problem.
Finally, do not forget to rename this image as bb_pdf.gif (or whatever you typed)and upload it to static/image/common.
Note : the browser should support pdf reading to view the file properly.

Special thank to @Dr AM.

kaaleth Publish time 2014-06-05 00:56

Good job! Works fine!

In my opinion you should explain HEIGHT field. What is this and what value people should put in.

mo5bzn Publish time 2014-06-05 01:15

static/image/common/user_online.gif kaaleth static/image/common/clock.gif 2014-6-4 22:56
Good job! Works fine!

In my opinion you should explain HEIGHT field. What is this and what value pe ...

Ok will add a little description about it.

mo5bzn Publish time 2014-06-05 01:22

static/image/common/user_online.gif kaaleth static/image/common/clock.gif 2014-6-4 22:56
Good job! Works fine!

In my opinion you should explain HEIGHT field. What is this and what value pe ...

Btw, always welcome, and thanks for the suggestion :victory:

vot Publish time 2014-06-05 06:42

Attention:
Do not forget about a security!
Any external file/document CAN be dangerous!!!

mo5bzn Publish time 2014-06-05 12:01

static/image/common/user_online.gif vot static/image/common/clock.gif 2014-6-5 04:42
Attention:
Do not forget about a security!
Any external file/document CAN be dangerous!!!

Please tell more, how is that ? It's a simple pdf file ..

vot Publish time 2014-06-05 15:00

Any external file can be specially prepared by hackers as a malware.
When you just click on such type infected file, you run the malware at your computer.

ravipratap95 Publish time 2014-06-05 15:05

static/image/common/user_online.gif mo5bzn static/image/common/clock.gif 2014-6-5 14:01
Please tell more, how is that ? It's a simple pdf file ..

pdf's can also do links opening
and other functions.
so yes they may be danerous
not to mention they can infect files with malware or viruses.

mo5bzn Publish time 2014-06-05 17:35

Yes that's right.
Pages: [1]
View full version: Show PDF Files Directly in the Thread