Elxis CMS Forum
Extensions => Tools => Topic started by: ks-net on October 27, 2008, 19:37:06
-
URI: index2.php?option=com_content&do_pdf=1&id=50
Path: /includes/tcpdf/tcpdf.php
Line: 3131
getimagesize(/XXXXXX/XXXXX.gr/html/includes/tcpdf//images/stories/ksworlwide_400.jpg) [function.getimagesize]: failed to open stream: No such file or directory
errors appear only if an image is in article else pdf convert works...
this double slash must break things down.
where to look and what to fix?
-
Try the following:
open includes/tcpdf/config/tcpdf_config.php
go to line 69
change the K_PATH_IMAGES constant to:
define ("K_PATH_IMAGES", $mainframe->getCfg('absolute_path').'/images/');
Tell me if the problem was solved.
Try also with:
define ("K_PATH_IMAGES", $mainframe->getCfg('absolute_path').'/');
-
Hi , I think that your problem is not related to the TCPDF ,
Try to edit your picture url , Just check if your picture address is like this : http://www.sample.com/images/stories/ksworlwide_400.jpg
Not this : /images/stories/ksworlwide_400.jpg
Good luck ;)
-
Farhad we better try to fix tcpdf even if the image has been entered with a relative path.
As a solution we could make tcpdf to replace the relative path with the full path in this occasion.
Please check my P.M.
-
Yes John , I am trying ...
-
Ok, I found the solution ...
Ignore all the last posts and do this :
Download attached file , Extract it and Replace the extracted file with file : \includes\tcpdf\config\tcpdf_config.php
----------------------------------------------------------------------------------------------------------------------------------
OR:
--------------------------------------------------
Edit \includes\tcpdf\config\tcpdf_config.php:
Replace :
define ("K_PATH_MAIN", $mainframe->getCfg( 'absolute_path' ).SEP."includes".SEP."tcpdf".SEP);
With:
define ("K_PATH_MAIN", $mainframe->getCfg( 'absolute_path' ).SEP);
and
Replace :
define ("K_PATH_FONTS", K_PATH_MAIN."fonts".SEP);
With:
define ("K_PATH_FONTS", K_PATH_MAIN.SEP."includes".SEP."tcpdf".SEP."fonts".SEP);
Tell me the result , Now you can use both relative and absolute image path :)
[attachment deleted by admin]
-
Test the above solution with various images (relative and absolute paths in various directories) and tell me if it always works.
If yes, we will added it to Elxis main release.
Farhad if you change the "K_PATH_MAIN" the script wont have problem including needed libraries? I think that you should only modify the "K_PATH_IMAGES" configuration parameter (I have nt tested it).
-
Is working now. I make test.
-
Here is a complete test :
http://www.parsmizban.com/salam.html
Just a picture in another site that included in the page can't be include in the exported PDF , This is normal because the TCPDF can't access to the actual file resource ...
Check it fast , Because it is on my live site :D
I'll remove it tonight
Problem solved !
-
OK, seems its working fine. I will also test it later and add it to Elxis.
Thanks farhad!
-
I added it the above solution in Elxis main release. 2 more things to pay attention:
1. The logo.png image is now taken from the main images/ directory and not from includes/tcpdf/images/ directory. So make sure there is always a "logo.png" file inside your images/ directory.
2. A fix for the blank image constant:
define ("K_BLANK_IMAGE", K_PATH_MAIN.SEP."includes".SEP."tcpdf".SEP."images".SEP."_blank.png");
Now everything is fine.
-
I added it the above solution in Elxis main release. 2 more things to pay attention:
1. The logo.png image is now taken from the main images/ directory and not from includes/tcpdf/images/ directory. So make sure there is always a "logo.png" file inside your images/ directory.
2. A fix for the blank image constant:
define ("K_BLANK_IMAGE", K_PATH_MAIN.SEP."includes".SEP."tcpdf".SEP."images".SEP."_blank.png");
Now everything is fine.
Is this fix valid for 2008.0 release and How to fix it?
Thanks
-
Yes, if you only modify the config file of tcpdf I guess it will work fine.
-
OK John , Thank you
To Amigamerlin :
TCPDF of 2008.0 is an old version , You can replace the folder of tcpdf to 2008.1 one ... It will be update to newer version , Then you can replace the config file that I attached ... :)
-
OK John , Thank you
To Amigamerlin :
TCPDF of 2008.0 is an old version , You can replace the folder of tcpdf to 2008.1 one ... It will be update to newer version , Then you can replace the config file that I attached ... :)
Thank you you all Farhad and John !!