MyBB Community Forums

Full Version: How To Post PDF or Word Doc File?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What I want to do is post a full PDF or Word Doc file into the post.

Yea, I know all about the attachment thing, but that is not what I want. 

I want something to look like this, but it's NOT an image (shown below), but the actual PDF or Doc file.

I already have the PDF file of this image you see below. 

Is there a way to do this?

[Image: vdXZfJ0.png]
You'd need to use a custom MyCode to embed a PDF, but you can't embed Word documents on the web, browsers don't know how to render those.

For a PDF, add a MyCode with these values.

Regular Expression:

\[pdf\](.*?)\[/pdf\]

Replacement:

<object type="application/pdf" data="$1" width="800" height="600"><param name="src" value="$1" /><embed src="$1" width="500" height="400" /><noembed><a href="$1" target="_blank">$1</a></noembed></object>

You can change the widths.

That will allow you to embed a PDF by URL, to have it so uploaded PDFs display like this would need a plugin, but doing it for Word docs isn't possible at all.
(2022-03-12, 01:18 PM)Matt Wrote: [ -> ]You'd need to use a custom MyCode to embed a PDF, but you can't embed Word documents on the web, browsers don't know how to render those.

For a PDF, add a MyCode with these values.

Regular Expression:

\[pdf\](.*?)\[/pdf\]

Replacement:

<object type="application/pdf" data="$1" width="800" height="600"><param name="src" value="$1" /><embed src="$1" width="500" height="400" /><noembed><a href="$1" target="_blank">$1</a></noembed></object>

You can change the widths.

That will allow you to embed a PDF by URL, to have it so uploaded PDFs display like this would need a plugin, but doing it for Word docs isn't possible at all.

Ok, I understand about the Word Doc. I can use PDF.

I put your code into MyCode in my ACP. 

But, how do I add this function in the Editor Menu?

[Image: vpQgkwe.png?1]

I am not familiar with MyCode and how it works in the Editor Menu. 

Thanks