| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 7302|Reply: 8
Collapse the left

Show PDF Files Directly in the Thread

[Copy link]

 Tunisia

Post time: 2014-06-05 00:03
| Show all posts |Read mode
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):
  1. pdf
Copy the Code

Replacement content:
  1. <p align="center">
  2. <iframe src="{1}" style="width: 100%; height: {2}px;" frameborder="0"></iframe></p>
Copy the Code

Example:
  1. [pdf]pdf-url-here[/pdf]
Copy the Code

Explanation:
  1. Add pdf file directly in the thread
Copy the Code

Number of parameters:
  1. 2
Copy the Code

Parameter prompt:
  1. File URL
  2. File height
Copy the Code


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.

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

Rate

Number of participants 1Rating +1 Collapse Reason
vot + 1

View Rating Log

Post time: 2014-06-05 00:56
| Show all posts
Good job! Works fine!

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

 Tunisia

 Author| Post time: 2014-06-05 01:15 From the mobile phone
| Show all posts
kaaleth 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.

 Tunisia

 Author| Post time: 2014-06-05 01:22 From the mobile phone
| Show all posts
kaaleth 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

 Russia

Post time: 2014-06-05 06:42
| Show all posts
Attention:
Do not forget about a security!
Any external file/document CAN be dangerous!!!

 Tunisia

 Author| Post time: 2014-06-05 12:01 From the mobile phone
| Show all posts
vot 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 ..

 Russia

Post time: 2014-06-05 15:00
| Show all posts
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.
Post time: 2014-06-05 15:05
| Show all posts
mo5bzn 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.

 Tunisia

 Author| Post time: 2014-06-05 17:35 From the mobile phone
| Show all posts
Yes that's right.
You have to log in before you can reply Login | Register

Points Rules

Archive|Mobile|Dark room|CodersClub

Top.Mail.Ru
Top.Mail.Ru

2024-11-25 01:15 GMT+3 , Processed in 0.077270 sec., 10 queries .

Powered by Discuz! X3.4 Release 20230520

© 2001-2024 Discuz! Team.

MultiLingual version, Rev. 4301, © codersclub.org

Quick Reply To Top Return to the list