Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1468)
PDF Tag
Version: 1.2 Date 2011-07-17
Compatibility: SMF 1.1.14 & SMF 2.0
Showing PDF Files in Posts with using [pdf] [/pdf] tag
Tips From FaSan -> http://www.simplemachines.org/community/index.php?topic=35851.0
Just packaged & attached PDF-Button in BBC-codes
You may get support or submit questions and comments in the modification's support thread at the SMF site.
Changelog:
v1.2 - 17 July 2011
o Added support for SMF 2.0 Gold.
v1.1 - 31 October 2008
o Added support for SMF 2.0 BETA 4.
v1.0 - 15 October 2008
o Initial release. (SMF 1.1.6 Compatible)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi36.tinypic.com%2Fzwz22x.jpg&hash=861bdcca39629ed712b18119c22daf1f548ba2e6)
Very nice, thanks,
Is it suppose to look like this thou:, not sure it meant to be but it seems to restrict the width.
Mathew
Nice mod. I adjusted the width and height to make the embeds larger by increasing their values in subs.php.
Quote from: weightman on October 31, 2008, 10:33:58 AM
Nice mod. I adjusted the width and height to make the embeds larger by increasing their values in subs.php.
Do you mind telling me what size you used? i dont want to make it to big so it is to large and ruins the look of theme if to wide etc.
Thank you,
Mathew
I really like this idea. Any plans for a SMF 2.0 version?
QuoteDo you mind telling me what size you used? i dont want to make it to big so it is to large and ruins the look of theme if to wide etc.
The width I used might not be optimal for your site since my forum is wrapped inside a bridged CMS. If you make the width too large it shouldn't wreck your pages. Instead the pdf should just get cut off. Then, you can just decrease the number til it fits. The height should work fine. I have it set to display the full first page.
<embed type="application/pdf" src="$1" width="775" height="975" />
Quote from: General_Naga on October 31, 2008, 12:04:11 PM
I really like this idea. Any plans for a SMF 2.0 version?
Yep,it will be shortly available for SMF 2.0 too
excellent
Great news - I look forward to it :)
Quote from: General_Naga on October 31, 2008, 02:48:28 PM
Great news - I look forward to it :)
Now it's SMF 2.0 Beta 4 compatible
http://custom.simplemachines.org/mods/index.php?action=download;mod=1468;id=74019
Quote from: weightman on October 31, 2008, 12:12:21 PM
QuoteDo you mind telling me what size you used? i dont want to make it to big so it is to large and ruins the look of theme if to wide etc.
The width I used might not be optimal for your site since my forum is wrapped inside a bridged CMS. If you make the width too large it shouldn't wreck your pages. Instead the pdf should just get cut off. Then, you can just decrease the number til it fits. The height should work fine. I have it set to display the full first page.
<embed type="application/pdf" src="$1" width="775" height="975" />
this could be one good addiction for new version to be able to change the size od document pdf in topic ;)
Quote from: edi67 on October 31, 2008, 03:59:51 PM
Quote from: weightman on October 31, 2008, 12:12:21 PM
QuoteDo you mind telling me what size you used? i dont want to make it to big so it is to large and ruins the look of theme if to wide etc.
The width I used might not be optimal for your site since my forum is wrapped inside a bridged CMS. If you make the width too large it shouldn't wreck your pages. Instead the pdf should just get cut off. Then, you can just decrease the number til it fits. The height should work fine. I have it set to display the full first page.
<embed type="application/pdf" src="$1" width="775" height="975" />
this could be one good addiction for new version to be able to change the size od document pdf in topic ;)
Good idea,i will add this in the new version ;)
Modifications.spanish.php:
$txt['pdf'] = 'Añadir PDF';
Modifications.spanish_latin.php:
$txt['pdf'] = 'Añadir PDF';
Modifications.spanish-utf8.php:
$txt['pdf'] = 'Añadir PDF';
Modifications.spanish_latin-utf8.php:
$txt['pdf'] = 'Añadir PDF';
Thanks for the mod
Very cool Thanx!
http://www.chevyavalancheclub.com/index.php/topic,2191.0.html
can be done something so it doesn`t load whole pdf at once and every time you refresh page ?
is a really big problem with files larger than 6 mb and especially with 30 mb files, IE loads it but a grey window is showing instead of the document, you have to refresh to load it again to show it normally ......
Hey All,
could someone tell me how to use this bbcode please, sence I'm not real sure how to place the pdf file into the tags.
cut and paste or is it to be attached some how?
Thanks Lots,
TTYL Flip
Quote from: ke4obt on February 19, 2009, 01:25:39 PM
Hey All,
could someone tell me how to use this bbcode please, sence I'm not real sure how to place the pdf file into the tags.
cut and paste or is it to be attached some how?
Thanks Lots,
TTYL Flip
[pdf]url of your pdf[/pdf]
Duncan,
thanks. My wife came and looked at the screenshot and then smacked me in the head. :)
My screen reader didn't read it for me since it was an image. So, had to use the wife's eyes - again.
Tried it out in a post and it worked perfectly!!
Thanks again.
TTYL,
Flip
resize on 2.0RC1... is it possible?
thank you :-)
Quote from: Rockas on February 25, 2009, 06:01:12 AM
resize on 2.0RC1... is it possible?
thank you :-)
I've already tried that with resizing,but unfortunately with no luck
I have installed this mod on a 2.0 RC-1 board. I used the pdf_tag_1.1.zip file and uploaded the package and it said it installed successfully. When I try to use the pdf tags and place a valid pdf file (on another site) I get a post that says "click here to download plugin" When I click it it says no plugin is available. Can someone help this poor newb get this working? I am sure I have done something basic incorrectly and will look forward to hearing about it. ;>)
KT
Solved it. Realized that it was my browser that needed the plugin. duh. For anyone else who has this problem you can find the Mac plugin here:
http://plugindoc.mozdev.org/OSX.html#PDF
I would like to embed an attached PDF. This does not work well at all.
Here is an example of embedding an "unattached" PDF
http://rockhallsailingclub.org/smf/index.php?topic=58.0
Here is an example, using the same PDF file. This time, though, I have attempted to attach it to a post and then embed it in the same post, using the PDF file. SMF insists that the attached PDF file needs to be opened in a new window. That really messes up the message window and the browser window with the empty object/embed window seems really unhappy, too.
http://rockhallsailingclub.org/smf/index.php?topic=76.0
Is there a solution to the problem?
Thanks
AB
Quote from: AngelinaBelle on June 22, 2009, 01:51:41 PM
I would like to embed an attached PDF. This does not work well at all.
Here is an example of embedding an "unattached" PDF
http://rockhallsailingclub.org/smf/index.php?topic=58.0
Here is an example, using the same PDF file. This time, though, I have attempted to attach it to a post and then embed it in the same post, using the PDF file. SMF insists that the attached PDF file needs to be opened in a new window. That really messes up the message window and the browser window with the empty object/embed window seems really unhappy, too.
http://rockhallsailingclub.org/smf/index.php?topic=76.0
Is there a solution to the problem?
Thanks
AB
PDF Tag mod has nothing to do with the attachment stuff,so i don't know what could be wrong with it
I have a problem with a mac/firefox os/browser combination. The PDF file seems to open a ways down on the page and the width stays too narrow even if the width variable is changed in subs.php Any ideas? Thanks.
Quote from: Duncan85 on June 22, 2009, 02:51:41 PM
PDF Tag mod has nothing to do with the attachment stuff,so i don't know what could be wrong with it
Thanks. That tells me it might not be so simple to attach a PDF and then embed the PDF. I'll go ask someplace else.
The PDF mod seems to be working great for what it was designed to do.
Thanks!
which file/template is the quick reply?
Nice nice nice nice.
Thanks
i am using Foxit Reader and i see X in PDF place.
any update for rc2?
Quote from: searchgr on November 11, 2009, 09:24:06 AM
any update for rc2?
Already tried to update,but no luck,somehow the pdf thing doesn't work on RC2
I got it to work on RC2 a while back ;)
Open:
./Sources/Subs.php
Find:array(
'tag' => 'pre',
'before' => '<pre>',
'after' => '</pre>',
),
Add before:
// PDF [pdf]example.pdf[/pdf]
array(
'tag' => 'pdf',
'type' => 'unparsed_content',
'content' => ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'] ? '<object type="application/pdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" 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>' : '<embed type="application/pdf" src="$1" width="500" height="400" /><noembed><a href="$1" target="_blank">$1</a></noembed>'),
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'url\']))
$tag[\'content\'] = \'$1\';'),
'disabled_content' => '<a href="$1" target="_blank">$1</a>',
),
Open:
Subs-Editor.php
Find:
array(
'image' => 'quote',
'code' => 'quote',
'before' => '[quote]',
'after' => '[/quote]',
'description' => $txt['bbc_quote']
),
Add after:
array(
'image' => 'pdf',
'code' => 'pdf',
'before' => '[pdf]',
'after' => '[/pdf]',
'description' => $txt['Add_PDF']
)
Open:
./Themes/default/languages/Modifications.english.php
Find:
?>
Add before:
$txt['Add_PDF'] = 'Add PDF';
Make sure you grab the PDF image from the package here and load it into your theme's BBC folder.
Demo on RC2:
http://www.chevyavalancheclub.com/index.php?action=articles;sa=view;article=47
It works in the forums as well in the Articles mod.
Thanks for posting that. You saved me thinking through and debugging the edit to Subs-Editor
Quote from: Duncan85 on November 12, 2009, 05:11:40 AM
Quote from: searchgr on November 11, 2009, 09:24:06 AM
any update for rc2?
Already tried to update,but no luck,somehow the pdf thing doesn't work on RC2
Here is a version for rc3
I'll remove it if you object to my posting it.
Quote from: ҰΛĥmΞڃ on April 20, 2010, 09:35:40 AM
Quote from: Duncan85 on November 12, 2009, 05:11:40 AM
Quote from: searchgr on November 11, 2009, 09:24:06 AM
any update for rc2?
Already tried to update,but no luck,somehow the pdf thing doesn't work on RC2
Here is a version for rc3
I'll remove it if you object to my posting it.
I have no,thanks for updating,when i have time,i will look into your package and add on modification page ;)
Quote
Here is a version for rc3
I'll remove it if you object to my posting it.
thank you very much !
i get an error with this saying. File does not begin with %PDF
How do i set it for Auto width.
Doesnt install on 2.0!
I realy need this mod. I have so many pdfs i have put in the messages with this mod but now i i upgraded it to 2.0 and you cant see any of the pdfs.
Please! When Is this gonna be updated for 2.0?
Would it be possible for you to update this to work with SMF 2.0 Gold please?
Quote from: npiccoli on July 12, 2011, 06:43:01 PM
Would it be possible for you to update this to work with SMF 2.0 Gold please?
http://www.simplemachines.org/community/index.php?topic=271504.msg2592280#msg2592280
Did you try the package from here ?
i just checked the code and modified it for 2.0 Gold (I installed it sucessful in my testforum)
Is this what you need? if yes, see attached file... - Nevertheless - all honours to Duncan85 - as i said - i just modifed it for 2.0 Gold only
http://aida32-inventory.netboom.de/smf/index.php?topic=211.msg1721#msg1721
cheers Inti31
Quote from: Inti31 on July 13, 2011, 02:59:34 AM
i just checked the code and modified it for 2.0 Gold (I installed it sucessful in my testforum)
Is this what you need? if yes, see attached file... - Nevertheless - all honours to Duncan85 - as i said - i just modifed it for 2.0 Gold only
http://aida32-inventory.netboom.de/smf/index.php?topic=211.msg1721#msg1721
cheers Inti31
Thank you! The modification installed, but now I need a PDF file to test the modification with. I'll find one somewhere, I wish this computer had Microsoft Office 2007 so I could easily create a PDF. Oh well, thanks!
Does it work for you? Did you test it? Please let me (us) know... cheers Inti31
Quote from: Inti31 on July 13, 2011, 01:28:26 PM
Does it work for you? Did you test it? Please let me (us) know... cheers Inti31
It is working as it should, thanks again!
Thanks for it Inti31 ;)
I got it installed in 2.0 but i get this error in my error log
8: Undefined index: pdf
Dosya: /home/site/public_html/forum/Sources/Subs-Editor.php
Line: 1589
Quote from: PLAYBOY on July 16, 2011, 10:55:06 PM
I got it installed in 2.0 but i get this error in my error log
8: Undefined index: pdf
Dosya: /home/site/public_html/forum/Sources/Subs-Editor.php
Line: 1589
I didn't get such error on fresh installation,better check your language files
What am i gonna look for in which language file?
Quote from: PLAYBOY on July 17, 2011, 01:48:42 AM
What am i gonna look for in which language file?
Modifications.english.php
Quote from: Kermit on July 17, 2011, 02:26:12 AM
Modifications.english.php
and what am i checking in this file? because i dont see anything wrong in my language files...
I can just say,check the coding of modification manually,if all is correct,then i don't know what could be the problem
Are you using an utf-8?
then you have to enter manually the string in this file: "Modifications.english-utf8.php" - or whatever language is you prefered one. The package does have only german-utf8 and simple English included.
$txt['pdf'] = 'add PDF';
So if you have a French forum you need to enter the code string in "Modifications.french-utf8.php" / "Modifications.french.php". and you need add the translation for "add PDF"
Quote from: Inti31 on July 17, 2011, 05:46:21 AM
Are you using an utf-8?
then you have to enter manually the string in this file: "Modifications.english-utf8.php" - or whatever language is you prefered one. The package does have only german-utf8 and simple English included.
$txt['pdf'] = 'add PDF';
So if you have a French forum you need to enter the code string in "Modifications.french-utf8.php" / "Modifications.french.php". and you need add the translation for "add PDF"
I just did. I ll let you know if the error occurs again.
Thx.
Good work
when update dont forget
<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['pdf'] = 'Adicionar PDF';]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['pdf'] = 'Adicionar PDF';]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_brazilian.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['pdf'] = 'Adicionar PDF';]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_brazilian-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['pdf'] = 'Adicionar PDF';]]></add>
</operation>
</file>
I just upgraded my site from SMF 1.07 to 2.02 and I lost PDF Tag as a result. Previously PDF tag was working flawlessly. Now after I installed it in 2.02 I get the dreaded "File does not begin with '%PDF'" error message and I do not know what to do.
I went through the instructions I have seen for the code that should be modified for PDF Tag and it all seems to be correct. Not sure what else I can do. Any help would be appreciated as this just caused major problems on my forum as we use embedded PDF's
Ok this is really odd. I just discovered this.... It will give the error message when I post the PDF message and view the post, but if I hit REPLY the PDF shows up fine with no error. Anyone have any ideas why it would do this. It was working fine before upgrading to SMF 2.0 from 1.17
great mod - works fine with Firefox - but when using IE i have run into problems. May someone is having an idea?
Here is the link: hxxp://www.fxtester.de/3562/erlaeuterungen-zum-forex-artikel/
thx Rob
Is it working with latest versions of SMF?
Yes
Regular members dont see the pdfs. It shows them like they are broken images. Just an X on the boxes. Can somebody please help me?
Also is there anyway to adjust the size of the boxes for pdfs? or maybe it would be a nice feature for the next version.
Thanks.
Quote from: r2d2-trader on February 01, 2012, 05:09:15 PM
great mod - works fine with Firefox - but when using IE i have run into problems. May someone is having an idea?
I'm having the same issue in SMF 2.0.3 - works fine in FF but not in IE10 (shows the frame of the box but just an X in the upper left corner).
FOLLOW UP: IE10 32-bit will display the pdf but not 64-bit. So if you insist on using IE, be sure it's the 32-bit version. Otherwise just use FF or Chrome, etc.
Quote from: aoife on January 17, 2013, 07:13:05 AM
Quote from: r2d2-trader on February 01, 2012, 05:09:15 PM
great mod - works fine with Firefox - but when using IE i have run into problems. May someone is having an idea?
I'm having the same issue in SMF 2.0.3 - works fine in FF but not in IE10 (shows the frame of the box but just an X in the upper left corner).
FOLLOW UP: IE10 32-bit will display the pdf but not 64-bit. So if you insist on using IE, be sure it's the 32-bit version. Otherwise just use FF or Chrome, etc.
aoife,
pdf file types will open in IE10 (64 bit) (via Adobe Reader) with a simple adjustment. This is assuming that you have Adobe Reader installed on your computer.
Open your IE10 64bit browser & navigate to the following:
Tools -> Internet Options -> Programs -> Set Programs -> Associate a file type or protocol with a program
.. it may take a moment to load all the varios file types. Scroll down to pdf file type & double click.. Opt Adobe Reader as the program to open those files, click OK & then click CLOSE.
After the above setting change you should be able to view pdf documents using the IE10 64bit browser (which uses Adobe Reader to view them/it).
Quote from: -Underdog- on January 18, 2013, 02:12:14 PM
Quote from: aoife on January 17, 2013, 07:13:05 AM
Quote from: r2d2-trader on February 01, 2012, 05:09:15 PM
great mod - works fine with Firefox - but when using IE i have run into problems. May someone is having an idea?
I'm having the same issue in SMF 2.0.3 - works fine in FF but not in IE10 (shows the frame of the box but just an X in the upper left corner).
FOLLOW UP: IE10 32-bit will display the pdf but not 64-bit. So if you insist on using IE, be sure it's the 32-bit version. Otherwise just use FF or Chrome, etc.
aoife,
pdf file types will open in IE10 (64 bit) (via Adobe Reader) with a simple adjustment. This is assuming that you have Adobe Reader installed on your computer.
Open your IE10 64bit browser & navigate to the following:
Tools -> Internet Options -> Programs -> Set Programs -> Associate a file type or protocol with a program
.. it may take a moment to load all the varios file types. Scroll down to pdf file type & double click.. Opt Adobe Reader as the program to open those files, click OK & then click CLOSE.
After the above setting change you should be able to view pdf documents using the IE10 64bit browser (which uses Adobe Reader to view them/it).
Thank you for the suggestion. I use Adobe Acrobat X and don't have Reader installed on my machines. The .pdf files are associated with Acrobat already - I redid the association and it still does not work with 64-bit. However, it works fine using IE10 32-bit; IE is not my default browser. I was simply looking for a solution for folks that are using the forums and who do use Internet Explorer - it's a solution I found on the Acrobat site.
Is there any way to embed an attached PDF?
Hi all,
Firstly i will say thank you for the mod !
Then i have a question : How i can change zoom of the PDF file for have the perfect scale ?
Example on my website : http://pafteam.com/forum/index.php?topic=5761.0
Thank you,
I don't know about setting the zoom, but you can set the widow size by modifying the code in Subs.php as follows:
// PDF [pdf]example.pdf[/pdf]
array(
'tag' => 'pdf',
'type' => 'unparsed_content',
'content' => ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'] ? '<object type="application/pdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" data="$1" width="800" height="600"><param name="src" value="$1"><embed src="$1" width="800" height="600" /><noembed><a href="$1" target="_blank">$1</a></noembed></object>' : '<embed type="application/pdf" src="$1" width="800" height="600" /><noembed><a href="$1" target="_blank">$1</a></noembed>'),
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'url\']))
$tag[\'content\'] = \'$1\';'),
'disabled_content' => '<a href="$1" target="_blank">$1</a>',
),
Aloha, is this MOD still supported? We are updating all our sites and the create_function code needs to be updated in this mod for PHP 7.2. If the MOD is not supported I will make the changes going forward for our sites.
This mod has a couple of shortcomings as you need the pdf to be located on your system and even then, it will only work on the desktop and not Android cellphones. It also has a 500px by 400px frame.
I have built a 1.3 version for a larger frame using 800x1000 pixels but decided to use this instead HTML code instead:
[html]<embed src="https://website/example.pdf" width="800px" height="1000px" />[/html]
For Android (cell phones) this link needs to be taken but works well for any online pdf:
Click on https://docs.google.com/viewerng/viewer?url=https://website/example.pdf
Quote from: aegersz on April 14, 2021, 05:33:48 PM
This mod has a couple of shortcomings as you need the pdf to be located on your system and even then, it will only work on the desktop and not Android cellphones. It also has a 500px by 400px frame.
I have built a 1.3 version for a larger frame using 800x1000 pixels but decided to use this instead HTML code instead:
[html]<embed src="https://website/example.pdf" width="800px" height="1000px" />[/html]
For Android (cell phones) this link needs to be taken but works well for any online pdf:
Click on https://docs.google.com/viewerng/viewer?url=https://website/example.pdf
please do not upload mods without the mod authors consent
Oh sorry about that - I didn't see any copyright so I thought it was ok.
It won't happen again.
there's more or less a blanket copyright here on smf....rule of thumb it's not ok to upload the entire mod without the mod authors ok...but you can put in a post instructions on how to update the mod for others use.
:laugh: no worries, I've been slapped myself for doing that as well :P