Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Articles/News 2 PDF

Hi folks.

I found an old mod that allows printing out articles & news as a .pdf-file.

Now I've come so far that it's "alive" again - lol, I just mean that it's working again - somehow at least..

It prints out the articles/news fine but I can't get it showing the news-cat-images nor images from the articles.

I think it's a great and usefull modification - but without printing images out it's nothing worth - IMO at least.

If someone want's to have a look at it I attach the files here.

Have a nice day all of you!

Merged on Apr 03 2012 at 22:38:04:
If I have a .gif in my news it won't show it:
www.phpfusion-tips.dk/news.php?readmo...admore=100

The error says it can't find the file no_img.gif - but it is there..
www.phpfusion-tips.dk/includes/output...no_img.gif

Besides that I dont know why it should show that no_img cause it should show my image from the news instead.

I'll investigate further into this - any help is of course apreciated.
smokeman attached the following file:
news_articles_2_pdf.zip [204.77kB / 305 Downloads]
includes/output_pdf/fpdf.php line #2209
replace function _parsegif {...}
with
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]function _parsegif($file)
{
//Extract info from a GIF file (via PNG conversion)
if(!function_exists('imagepng'wink)
$this->Error('GD extension is required for GIF support'wink;
if(!function_exists('imagecreatefromgif'wink)
$this->Error('GD has no GIF read support'wink;
$im=imagecreatefromgif($file);
if(!$im)
$this->Error('Missing or incorrect image file: '.$file);
imageinterlace($im,0);
$tmp=tempnam('.','gif'wink;
if(!$tmp)
$this->Error('Unable to create a temporary file'wink;
if(!imagepng($im,$tmp))
$this->Error('Error while saving to temporary file'wink;
imagedestroy($im);
$info=$this->_parsepng($tmp);
unlink($tmp);
return $info;
}[/syntaxhighlighter]
Source: http://code.google.com/p/html2pdf/iss...il?id=2#c3, first result for "FPDF error: GIF parser: unable to open file" on Google

There are still several issues with this mod.
How embarrassing - I normally always use Google and search first, but I thought "FPDF" only was for this mod/used in this mod and did not expect it was mentioned anywhere else. (you can hear I do not know anything about it, lol).

Anyway your solution is working but it does not show all of the image:
http://www.phpfusion-tips.dk/news.php...admore=113

What are the other issues with this mod ?

Thanks by the way for looking at it.
bump any news or updates im looking for a pdf panel say i have a some pdf files i want to display on site in a panel etc any good ??

Quote

supersonic wrote:

bump any news or updates im looking for a pdf panel say i have a some pdf files i want to display on site in a panel etc any good ??


in navigation you can add this code: ( custom pages )

CodeDownload  
<?php
echo "<iframe src='http://my.domain.com/guides/morchok.pdf' TYPE='application/x-pdf' TITLE='Morchok Raid Guide' WIDTH='100%' HEIGHT='600'></iframe><p><ahref='http://my.domain.com/guides/morchok.pdf'><strong>open in fullscreen...</strong></a></p>";
?>



( /guides/ is a folder made only for the pdf files, call it what you want and change the link of course ) Remember to add a link to navigation too ( of course ).

For FAQ:
first add question, then add the code as answer.

CodeDownload  
<iframe src='http://my.domain.com/guides/morchok.pdf' TYPE='application/x-pdf' TITLE='Morchok Raid Guide' WIDTH='100%' HEIGHT='600'></iframe><p><a href='http://my.domain.com/guides/morchok.pdf'><strong>open in fullscreen...</strong></a></p>




for News its the same code as for FAQ.

Merged on Oct 23 2012 at 11:14:45:

Quote

smokeman wrote:

How embarrassing - I normally always use Google and search first, but I thought "FPDF" only was for this mod/used in this mod and did not expect it was mentioned anywhere else. (you can hear I do not know anything about it, lol).

Anyway your solution is working but it does not show all of the image:
http://www.phpfusion-tips.dk/news.php...admore=113

What are the other issues with this mod ?

Thanks by the way for looking at it.


Thanks Smokey ;)

and gj on this, this should actually be implemented in fusion as standard :D only problem with it now ( which is a minor 1 ) is when you download the pdf it says: Do you wanna save the changes of my_file.pdf before it will be send?
Thread Information
Author
Replies
5 posts
Views
3,676 times
Last Post
Last updated on 8 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: val, smokeman, JoiNNN, supersonic