forgot password?


   
2 of 2
2
Logo missing in PDF
Posted: 20 February 2008 09:03 AM   [ Ignore ]   [ # 16 ]  
Newbie
Rank
Total Posts:  4
Joined  2008-02-20

Hi ,

I didnt have any error message just a pdf thats created with an x in the upper right hand corner where the logo should be. I followed this thread and tried adding the line for path resolve to solve problem with no luck .

Is there a log I can check for errors ?

Profile
 
 
Posted: 20 February 2008 12:40 PM   [ Ignore ]   [ # 17 ]  
Jr. Member
RankRank
Total Posts:  36
Joined  2007-09-16
hayden - 20 February 2008 03:03 AM

Ive added line 130 :
$resolved_url = “/home/content/h/b/a/hbarilefeh/html/few/bambooinvoice/” . $resolved_url;

Hi.

Try replacing the above with

$resolved_url “http://www.yourdomain.com/base_dir_of_bamboo_install/” . $resolved_url;

The base_dir_of_bamboo_install has to be the one with the img directory in it.

Give us news.

 Signature 

Marc Arbour
Senior coder at Ci².ca
My users community Ci³.ca

Profile
 
 
Posted: 20 February 2008 07:54 PM   [ Ignore ]   [ # 18 ]  
Newbie
Rank
Total Posts:  4
Joined  2008-02-20

Greetings,

I Replaced line 130 with
$resolved_url = “http://www.flatearthtrade.com/few/bambooinvoice/” . $resolved_url;

However it produces a pdf invoice succesfully (no error messages) but no logo on it just the red X on the upper right hand corner ?…

I can give you guys access offline if you want to take a look , there its pretty much a test environment

Profile
 
 
Posted: 20 February 2008 10:02 PM   [ Ignore ]   [ # 19 ]  
Jr. Member
RankRank
Total Posts:  36
Joined  2007-09-16

ok, let’s try this:
momentarely change line 130 do

die(“http://www.flatearthtrade.com/few/bambooinvoice/” . $resolved_url);

and produce a pdf.
it’ll ouput a url to a white screen.

copy paste that url in the address bar. You should not see an image (that’s why your pdf has red x)…
then, manually correct the url so you do see the logo, then reput line 130 as it was, bringing it the corrections made manually at the url.
to the best of my knowledge, the resulting url should be http://www.flatearthtrade.com/few/bambooinvoice/img/logo/logo.jpg
I did try that url myself only to find out that the logo isn’t where it’s supposed to be.
Have you double checked that there is a folder img, in it a folder logo and in it an image called logo.jpg?
Have you checked that your apache server can read and execute file in that subdirectory… and all of its parent directories?
try this: http://facturation.ci2.ca/img/logo/logo.jpg (this is my logo at my url…
Honestly… I think your bambooinvoice installation is at fault here. If checking all my above recomendations don’t fix it, I suggest, if possible to physically take a look at your installation.

regards

 Signature 

Marc Arbour
Senior coder at Ci².ca
My users community Ci³.ca

Profile
 
 
Posted: 20 February 2008 11:56 PM   [ Ignore ]   [ # 20 ]  
Newbie
Rank
Total Posts:  4
Joined  2008-02-20

ok Followed your steps , at first I got this which explains why It wasn’t finding the logo
http://www.flatearthweb.com/few/bambooinvoice//img/logo/logo.jpg

Removing the extra slash brought up the logo like you said in the right location. Went and re checked permissions on img/logo/log.jpg and made sure all were 755

Reran the die command less the slash at end and got correct URL
die(“http://www.flatearthtrade.com/few/bambooinvoice” . $resolved_url);

http://www.flatearthweb.com/few/bambooinvoice/img/logo/logo.jpg

Went back and changed line 130 to this less the slash
$resolved_url = “http://www.flatearthweb.com/few/bambooinvoice” . $resolved_url;

However still getting red x in pdf

When I went back to my my original, config.php , $config[’base_url’] I noticed I had a slash at end of it
$config[’base_url’] = “http://www.flatearthweb.com/few/bambooinvoice/”;

The comments say ,
// This should be a full address, with a slash. For example, here’s what
// I use on bambooinvoice.org:
//$config[’base_url’] = “http://www.bambooinvoice.org/”;

However the notes from install pdf say
set your $config[’base_url’]. If you are running this off a website it will be
“http://www.yoursite.com” or “http://www.yoursite.com/bambooinvoice” or
similar.

Willing to try reinstall if this is source of problem but before I do just want to make sure I specify base URL properly unless you have more suggestions?

( appologies above I put wrong url in previous post which was why you weren’t seeing image. IT’s flatearthweb not trade)

Profile
 
 
Posted: 21 February 2008 09:26 AM   [ Ignore ]   [ # 21 ]  
Jr. Member
RankRank
Total Posts:  36
Joined  2007-09-16

appologies accepted.
I confirm that $config[’base_url’] needs a trailing slash.
You sais you checked permissions on the file… but did you also checked permission on the directory and parent directories? If the second directory up the tree is 644, it’s possible that the apache server serves the image when directly URL’d but the script that creates the pdf can’t get to it. Just make sure that all directories and files are 755 all the way up (but the tmp folder that has to remain 777 for pdf creation).
If nothing fixes it I am willing to put an eye in your ftp if you are still willing to.
I would only need your ftp user/pass as well as your bambooinvoice installation user/pass. This forums doesn’t allow mails or PM, so send these in a text file that is zipped and attached to an email at marbour at “see-I-two” dot “see-hey” and I’ll take a look. (I wrote my email address in phonetics for it not to be harvested by robots, look at my forum signature if you have problems with my phonetics)

 Signature 

Marc Arbour
Senior coder at Ci².ca
My users community Ci³.ca

Profile
 
 
Posted: 21 February 2008 09:38 PM   [ Ignore ]   [ # 22 ]  
Jr. Member
RankRank
Total Posts:  36
Joined  2007-09-16

Hi.

I did receive your email.
Here is what I have in checking config.php. I see

$config['index_page'"index.php?";

while it should be

$config[’index_page’] = “index.php”;

But that’s minor.
.
.
MOUHAHAHA! I got it!
It gave me a headache, but I finally got it.
you logo.jpg is in fact a gif renamed to jpg. The browser can interpret them, but the dompdf was looking for the headers of a jpeg and found headers for a gif… so it reverted to the red x…
Here is how I got to find it… see attached image.
I renamed your logo.jpg in gif… opened it with my favorite image editor and saved it as a REAL jpg.

Voilà!
Your PDF are fine now.
.
you owe (I don’t know the proper conjugation for owing) me a coffee for that. Since we seem to live quite far from one another, may I suggest, if you wish, to donate the equivalent of the price of a coffee to some organization you know and trust that is helping people.
I’ll consider the coffee good, very hot, appreciated and southing.

Regards.

Image Attachments
image_problem.jpg
 Signature 

Marc Arbour
Senior coder at Ci².ca
My users community Ci³.ca

Profile
 
 
Posted: 21 February 2008 09:43 PM   [ Ignore ]   [ # 23 ]  
Jr. Member
RankRank
Total Posts:  36
Joined  2007-09-16

Derek,
I would like to request from you a thread split on this…
same symptom, different causes.
Might I also suggest that you add a note in the bambooinvoice joined pdf with installation instructions that renamed gif’s don’t work in places of jpg’s. Even if browsers get them ok, the pdf parser can’t.

Thanks Derek.

 Signature 

Marc Arbour
Senior coder at Ci².ca
My users community Ci³.ca

Profile
 
 
Posted: 11 March 2008 01:55 AM   [ Ignore ]   [ # 24 ]  
Newbie
Rank
Total Posts:  2
Joined  2008-03-11

Hi all. Great software.

I’ve been following this problem as it’s affected me to. Here’s my solution that doesn’t rely on a hard coded path:

At line 130 in bamboo_system_files/plugins/dompdf/include/image_cache.cls.php

$resolved_url $_SERVER["DOCUMENT_ROOT"$resolved_url;

Cheers,
Raoul

Profile
 
 
Posted: 11 March 2008 08:10 AM   [ Ignore ]   [ # 25 ]  
Administrator
RankRankRankRank
Total Posts:  809
Joined  2007-09-16

Thanks Raoul!
Derek

Profile
 
 
Posted: 11 March 2008 08:14 AM   [ Ignore ]   [ # 26 ]  
Administrator
RankRankRankRank
Total Posts:  809
Joined  2007-09-16

@Marc: sincere thanks for your work here.  I’m going to try to work out the best way to roll out your changes into Bamboo and re-distribute.  I appreciate the efforts you put in here.  Yeoman work!  Thanks.

Derek

Profile
 
 
Posted: 03 June 2008 11:13 AM   [ Ignore ]   [ # 27 ]  
Newbie
Rank
Total Posts:  3
Joined  2008-06-03

My Bamboo system runs at http://www.domain.ext/bamboo.  I wish not to use a company logo.  Building on Raoulw’s advice, I inserted the following into bamboo_system_files/plugins/dompdf/include/image_cache.cls.php line 130:

$resolved_url $_SERVER["DOCUMENT_ROOT""/bamboo" $resolved_url;

and created a 1x1 white jpeg to put into img/logo/logo.jpg.  According to the installation documentation:

Company logos are pulled from “/img/logo/logo.jpg”. If you’d like your logo added to
HTML and PDF invoices, simply put it in there (it must be named “logo.jpg”).

This would seem to imply that if you don’t want a logo, you could just remove img/logo/logo.jpg.  For future releases, would it be prudent to consider replacing res/broken_image.png with a 1x1 white jpeg?

Or maybe a more elegant solution would be instead to add a config option for $config[’logo_img’]="/full/path/to/logo/location.jpg" and another for $config[’use_logo’]=boolean.  If $config[’use_logo’] and !is_readable($config[’logo_img’]) || !filesize($config[’logo_img’]), then display res/broken_image.png.  Otherwise, if !$config[’use_logo’], skip including the logo.

Profile
 
 
Posted: 12 June 2008 01:28 PM   [ Ignore ]   [ # 28 ]  
Newbie
Rank
Total Posts:  1
Joined  2008-06-12

I would like to note that there is an issue with not using a logo on the pdf, as it will display an X inplace of it.  (This may be causing some of the other issues at hand here) I saw a few hacks for it but these don’t correct the problem at the source.  The fix is fairly simple by just correcting one line within the controller:

From within the application code in the system directory /application/controllers/invoices.php scroll down to the function name pdf.  You will see the line:

$data['company_logo'get_logo($this->settings_model->getSetting('logo_pdf'));

replace it with this line:

$data['company_logo'get_logo($this->settings_model->getSetting('logo_pdf'),FALSE);

and save.  This correctly defaults the company logo if it does not exist.

Profile
 
 
   
2 of 2
2