export to PDF: no images

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

telenut
Posts: 68
Joined: Thu Sep 09, 2004 10:13 am

export to PDF: no images

Post by telenut »

Seems like there are no images in the PDF's when I create them with version 1.5.0
With the 1.4.7 version, I have no problems. Could the location of the images have something to do with it?
Thorsten
Posts: 15731
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

there are some problems with images in 1.5. How do you include the images?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
DaRichMan
Posts: 21
Joined: Mon Jun 14, 2004 9:55 am
Location: Oldenzaal [NL]

Post by DaRichMan »

Same problem here. No error message but no images in the PDF.

- phpMyFAQ 1.5.4
- PHP Version 5.0.4
Thorsten
Posts: 15731
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

can you show me your FAQ?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
abdogeo
Posts: 7
Joined: Thu Feb 15, 2007 4:18 am
Location: Sydney
Contact:

Same Problem version 1.6.9

Post by abdogeo »

I run PMF on RHEL 4, I've also got full 777 permissions to all the PMF folders/files.
When I try to generate a PDF from an article, the images do not export. I get no error messages at all. The PDF file loads fine, but the images don't work.

At first, I had .png files, I changed that to .gif, still no luck.
I tried relative paths, and full paths to the images, and still no luck.

Any ideas on what else could be causing this?

Thanks
George
Thorsten
Posts: 15731
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

.gif is not supported in the PDFs. Do you see any errors in your errorlog?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
abdogeo
Posts: 7
Joined: Thu Feb 15, 2007 4:18 am
Location: Sydney
Contact:

Image Format and inclusion in PDF

Post by abdogeo »

Thanks Thorsten for the reply. I just created a new entry in my FAQ and this time, I uploaded the images in JPEG format. The PDF export worked as expected. The images were visible.

I have tried this with PNG images but it did not work. Obviously, like you said, GIFs don't work either.

So, unless I'm mistaken, it seems that only JPEGs get loaded into PDFs.

I have a question though. You mention if I've looked at the error log. Can you please let me know where is or which error log I should be looking at.
Thanks

George
Thorsten
Posts: 15731
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

if the PNGs have an alpha channel you can't see them. Only 8Bit and 24Bit PNGs were shown in the PDFs.

If you have an own server you could look in the apache errorlog for example.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
yanns
Posts: 1
Joined: Fri Jan 18, 2008 9:15 pm

Post by yanns »

Hello,
I have a problem with PDF generation and images with V2.0.4.
I have tried to include a .gif, a .jpg and a .png in a test record. None of these pictures are printed on the PDF file.

I read this forum about this problem, and tried to modify the path to my images from :
/images/... to ./images/.. but the HTML Editor automatically changes this path.

I have no error message and the text part of the PDF file is OK.

Is there a way to solve this?
Thank you.
Y.
Thorsten
Posts: 15731
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

I'll take a look at it.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
dirkbaier
Posts: 15
Joined: Sun Jul 29, 2007 9:54 am
Contact:

Post by dirkbaier »

Same Problem here with 2.0.5.
Grüße,
Dirk
dirkbaier
Posts: 15
Joined: Sun Jul 29, 2007 9:54 am
Contact:

Post by dirkbaier »

Pulling softly to the top.
:wink:

Same with 2.0.8
Grüße,
Dirk
HerrB
Posts: 4
Joined: Mon Jun 25, 2007 9:36 pm

Post by HerrB »

I don't know, if this has been fixed. Fix for 2.0.6 and above may be:

AddImage method in Pdf.php in inc\PMF_Export:
Change

Code: Select all

        if ('http' != substr($image, 0, 4)) {
            // Please note that the image must be accessible by HTTP NOT ONLY by HTTPS
            $image = 'http://'.$_SERVER['HTTP_HOST'].$image;
        }
to

Code: Select all

        if ('http' != substr($image, 0, 4)) {
            // Please note that the image must be accessible by HTTP NOT ONLY by HTTPS
            $image = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/'.$image;
        }
($image line only)

Explanation: If an image isn't fully referenced (incl. http), "http" and the domain will be added to the path. If you use PHPMyFAQ in a subfolder, this folder won't get added to the path. tinyMCE itself uses a relative path excluding the PHPMyFAQ subfolder, so the subfolder is always missing.

Regards,

HerrB
johanna
Posts: 23
Joined: Mon Jun 08, 2009 1:09 pm
Location: Finland

Re: export to PDF: no images

Post by johanna »

I just updated to 2.0.15 and noticed that export to PDF with images doesn't work at all. Export with no images works nicely. Am I doing something wrong or is this a bug?
Thorsten
Posts: 15731
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: export to PDF: no images

Post by Thorsten »

Hi Johanna,

could you please try toi enable the DEBUG mode in inc/Init.php and post the error messages here.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply