Author Topic: Broken logo in PDF invoice  (Read 2733 times)

Offline pwidner

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Broken logo in PDF invoice
« Reply #15 on: 14/June/2012, 02:30:59 PM »
I'm evaluating your product and all is great except for almost same issue. I have the logo showing in pdf's but only in backend. From the frontend I can't get the logo to show when user logs in and clicks pdf icon to view invoice.
I have set all permissions of course.
I also installed pdfwriter on frontend.
I went and got the latest html2ps and installed it and got the script working as well on both front and back but same effect with pdf not showing logo on front end.
I also edited index file in invoice template for direct image url link. I changed back after that didn't work.
I have searched everywhere and still searching for solution.
Any ideas?

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,959
    • View Profile
Re: Broken logo in PDF invoice
« Reply #16 on: 14/June/2012, 03:07:30 PM »
When you entered the URL to the image on the invoice template file, did you use a direct link to the image file, or the indirect link that goes through index.php?

On line 159 of the index.php file of the default template, where it says:

<img src="<?php echo "$logo_src"; ?>" alt="Logo" /><?php

...did you try this?...

<img src="http://www.example.com/components/com_nbill/images/vendors/1.gif" alt="Logo" /><?php

(where example.com is changed to your domain, and the 1 of 1.gif is changed to the ID number of your vendor record, and the .gif is change to .png if your vendor logo is a png file)

Offline pwidner

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Broken logo in PDF invoice
« Reply #17 on: 14/June/2012, 03:12:04 PM »
Wow fast response. I just fixed. It was the https in url causing problem.
So in default invoice template I changed to http absolute url and all works.
Thank you for the fast response!

Offline pwidner

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Broken logo in PDF invoice
« Reply #18 on: 14/June/2012, 03:13:56 PM »
Oh just another note on my problem configuration, all settings are for ssl enabled.

Offline pwidner

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Broken logo in PDF invoice
« Reply #19 on: 14/June/2012, 03:43:14 PM »
Nope, i still have an issue. I need absolute path to logo to be https. Now the problem is when a user views the html link, the dreaded IE security warning now pops up. I changed back the index file to https link and now frontend is back to not displaying logo. Bakend does?
Also know that direct https url to image does show stndalone image in browser window. So it is accessable.
Any more ideas?
« Last Edit: 14/June/2012, 03:45:42 PM by pwidner »

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,959
    • View Profile
Re: Broken logo in PDF invoice
« Reply #20 on: 14/June/2012, 07:18:30 PM »
Well, you could use http just for PDF generation, and still have https for viewing in a web browser:

<img src="<?php echo $pdf ? 'http' : 'https'; ?>://www.example.com/components/com_nbill/images/vendors/1.gif" alt="Logo" /><?php

Offline pwidner

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Broken logo in PDF invoice
« Reply #21 on: 14/June/2012, 08:13:08 PM »
Almost worked. I applied your code. PDF logo generation now works front and back. Now the problem is viewing html version of invoice from frontend. The IE warning comes up because it is calling for the http logo url while I'm logged in under https.
So to really solve, I probally need to figure out how to maybe open new browser in http or to do a redirect to http on new browser window open. What do you think?

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,959
    • View Profile
Re: Broken logo in PDF invoice
« Reply #22 on: 14/June/2012, 08:18:45 PM »
The above code should always use https for html invoices and always use http for PDF invoices. Are you sure you typed it all correctly? If so, I would need access to your site to look into it further, so you would need to submit a support ticket.

Offline pwidner

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Broken logo in PDF invoice
« Reply #23 on: 14/June/2012, 08:31:26 PM »
It starts as http but then changes to https in new browser opening? Is it because of config for setting yes to Use SSL for ALL pages? 
I will have to purchase for support ticket correct? I probally will anyway. There are just a few features I will need to implement later with some custom coding. Off topic but the income ledger is confusing especially with out put to invoice view.

Offline pwidner

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Broken logo in PDF invoice
« Reply #24 on: 14/June/2012, 08:52:42 PM »
Sorry looking back at the last 2 posts, I made no sense. Sorry for posting.
I used HttpWatch and see the code is calling http for components/com_nbill/templates/invoice_default/print.css
This is what is kicking in the IE warning now.

Offline pwidner

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Broken logo in PDF invoice
« Reply #25 on: 14/June/2012, 09:22:56 PM »
Solved!
I'm not sure this is the correct way to do this, but with the code you suppiled to change index file under default invoice template
and then I made this change to /administrator/components/com_nbill/admin.html/invoices.html.php

replaced line 3255       $print_css = file_exists("$include_path/print.css");
with https path           $print_css = file_exists("https://www.mywebsite.com/components/com_nbill/templates/invoice_default/print.css");

It all works now. Thank you for the guidance.

Offline richo

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Broken logo in PDF invoice
« Reply #26 on: 01/July/2012, 12:13:48 PM »
Hello,
I have change url to /administrator/components/com_nbill/admin.html/invoices.html.php
and components/com_nbill/templates/invoice_default/index.php
but I have same problem with generator pdf invoice.  :(

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,959
    • View Profile
Re: Broken logo in PDF invoice
« Reply #27 on: 01/July/2012, 10:04:34 PM »
I have change url to /administrator/components/com_nbill/admin.html/invoices.html.php
and components/com_nbill/templates/invoice_default/index.php
Neither of those addresses point to the logo file. Try http://www.example.com/compoennts/com_nbill/images/vendors/1.gif (or 1.png if your vendor logo is a .png file) where example.com is replaced with your actual domain name, and 1 is replaced with your vendor ID (it probably is 1 unless you created another vendor record).

Offline richo

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Broken logo in PDF invoice
« Reply #28 on: 02/July/2012, 01:33:15 AM »
My logo is here
Code: [Select]
http://www.rgdesign.fr/components/com_nbill/images/vendors/1.gif
And on my file : components/com_nbill/templates/invoice_default/index.php

Code: [Select]
<?php if (file_exists($logo_file))
                { 
?>

                    <img src="http://www.rgdesign.fr/components/com_nbill/images/vendors/1.gif" alt="Logo RG Design" /><?php

 ???

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,959
    • View Profile
Re: Broken logo in PDF invoice
« Reply #29 on: 13/July/2012, 10:05:40 AM »
If that still isn't working, I would need access to your site to look into it further, so please submit a support ticket.