[SOLVED+Guide] Logo standard in print page button and PDF

General questions relating to Joomla! 1.5 There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
monsterboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Nov 19, 2007 8:32 pm

[SOLVED+Guide] Logo standard in print page button and PDF

Post by monsterboy » Mon Feb 23, 2009 12:35 pm

NEW POST :

This guide was written for joomla 1.5.9 (good possibility that this also works with previous versions or upcoming versions) I dont take any responsebility for any problem that occurs after you've followed this guide!

Problem : Print page and PDF doesn't include own image/logo

Solution :

for Print problem :
1. Copy the file ''component.php'' from the folder joomla-installation/templates/system to the root of the the template folder of your template that your using now.
(for example : joomla-installation/templates/rhuk_milkyway/component.php)
2. If you need to overwrite some component.php in your new placed template folder, don't do it, as it may include code that the template needs to use (I don't know but its safer if you don't do this action in this case).
3. Now open the component.php file in your template folder (you can use wordpad)
4. Search for the line that states :

Code: Select all

<body class="contentpane">
.
5. Now just copy and place this code right under it :

Code: Select all

<img src="www.yourwebsite.nl/templates/your-template-folder/your-images-map/logo.png" alt="Logo" />
6. Just change the source of the image so it matches exact the image that you want included and thats it!




for PDF problem :
1. Download the component called : phocapdf, from this website : http://www.phoca.cz/phocapdf
2. Install the component like a normal component in your joomla installation.
3. Now download the Phoca PDF content plugin : http://www.phoca.cz/phocapdf-plugins
4. Install the plugin like a normal plugin in your joomla installation.
!!!!!!!Don't forget to enable the plugin AFTER you installed the component in the plugin manager tab!!!!!!! (it crashed my joomla installation)
5. Now go to the tab ''components'' in joomla and choose ''plugins''
6. Just go to the ''header'' tab and click the insert image in your wysiwyg editor.
7. After your finished just hit the ''Save'' button and your good to go!



Thanks to Olaf for helping me with this problem and let me be able to let others know the solution for these problems with this guide.


Greetz monsterboy






ORIGINAL POST :

Hi people,

I have a fairly simple problem (which I offcourse couldn't solve).

If I watch an article, you can see a print article button on it.
But when you press it, you only print the text of that article.
I also want to let it print the Logo of the website with it. (this needs to be standard)

How can I do this?
Is it also possible to let it print the logo with it when I hit the Print button of my browser?

This was no problem with the cms : drupal , so it shouldn't be a problem in joomla.

Thanks in advance ;)
greetz monsterboy
Last edited by monsterboy on Sat Feb 28, 2009 8:22 am, edited 2 times in total.

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11387
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: Get logo in standard print page button

Post by ooffick » Mon Feb 23, 2009 2:08 pm

Hi,

you can change that page, by modifying the components.php file in your template folder.

Olaf
Olaf Offick - Global Moderator
learnskills.org

monsterboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Nov 19, 2007 8:32 pm

Re: Get logo in standard print page button

Post by monsterboy » Mon Feb 23, 2009 4:48 pm

Thanks, for the response.

I'll take a look at it, ill keep you informed if I got managed to solve the problem.

Greetz monsterboy

monsterboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Nov 19, 2007 8:32 pm

Re: Get logo in standard print page button

Post by monsterboy » Tue Feb 24, 2009 9:07 pm

Hey,

I'm using a template that hasn't have a component.php included in it... it only has a module.php but thats probably not the same.

Could you please help me how to make a component.php file so it would work ?
maybe just the basics or a link to a wiki page that could help me further.

Thanks !

Greetz monsterboy

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11387
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: Get logo in standard print page button

Post by ooffick » Wed Feb 25, 2009 10:55 am

Hi,

copy the following file into your template directory

Code: Select all

/.../templates/system/component.php
Olaf
Olaf Offick - Global Moderator
learnskills.org

monsterboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Nov 19, 2007 8:32 pm

Re: Get logo in standard print page button

Post by monsterboy » Wed Feb 25, 2009 12:53 pm

Hey,

I did what you stated, but it didn't solve anything :S

When I want to print the page (im using firefox) I still get the same result, Its just a page without any logo of the company.

Just to make things more clear, im using the template from RocketTheme, called : Versatility.


Thank you for all the effort and fast responses.

Greetz monsterboy

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11387
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: Get logo in standard print page button

Post by ooffick » Wed Feb 25, 2009 1:53 pm

What did you do?
You changed the components.php file as well?

Olaf
Olaf Offick - Global Moderator
learnskills.org

monsterboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Nov 19, 2007 8:32 pm

Re: Get logo in standard print page button

Post by monsterboy » Wed Feb 25, 2009 5:30 pm

Hi,

I copyed the file ''component.php'' from the folder ''system'' to my template folder called : ''rt_versatility4_j15''

There didn't change anything. I still get the same result.
Is there maybe a Script or code that i need to implement in my template to let it include the file?


Greetz Monsterboy

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11387
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: Get logo in standard print page button

Post by ooffick » Thu Feb 26, 2009 10:49 am

You will need to add the HTML code for the logo to that component.php file. In this case, when you click on the print button on the joomla page, the pop-up window displays the logo, and therefore the printed page as well.

Olaf
Olaf Offick - Global Moderator
learnskills.org

monsterboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Nov 19, 2007 8:32 pm

Re: Get logo in standard print page button

Post by monsterboy » Fri Feb 27, 2009 11:00 am

Hi,

Thank you very much ! it solved my problem, but now I've found another little problem.

When you click on the button ''PDF'' it shows a nice PDF file, but this file doesn't contain our company logo.
How can I solve this?


Thank you very much for all your help ! without you I couldn't solve it :D


Greetz monsterboy

PS : when i solved every problem I have with the company logo, I'll post a guide so people that are searching this forum and do have the same problem can solve it right away ;)

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11387
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: Get logo in standard print page button

Post by ooffick » Fri Feb 27, 2009 11:27 am

If you want to insert the company logo on each page of the PDF, this is (AFAIK) not possible without changing the Joomla Core files. (/.../libraries/joomla/document/pdf/pdf.php:211)

If the logo on the first page is enough, you could write a small content plugin (name: image) to add the image before the actual content.

Olaf
Olaf Offick - Global Moderator
learnskills.org

monsterboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Nov 19, 2007 8:32 pm

Re: Get logo in standard print page button

Post by monsterboy » Fri Feb 27, 2009 4:46 pm

Yes I would like to have the logo included in every PDF that joomla puts out.

I looked into the code but I don't have any clue where to start or how I'm able to inlude the image. (its in .png format)

Greetz monsterboy

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11387
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: Get logo in standard print page button

Post by ooffick » Fri Feb 27, 2009 5:31 pm

The question is whether it would be enough, if you have the logo only on the first page of each PDF.

Olaf
Olaf Offick - Global Moderator
learnskills.org

monsterboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Nov 19, 2007 8:32 pm

Re: Get logo in standard print page button

Post by monsterboy » Fri Feb 27, 2009 5:46 pm

Sorry now I don't understand anymore what your talking now :P
Maybe we misunderstood eachother ;)

The problem was that if a visitor clicks on the PDF icon of an article, he wouldn't see the logo.



Thanks for the help!

Greetz monsterboy

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11387
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: Get logo in standard print page button

Post by ooffick » Fri Feb 27, 2009 6:20 pm

Yes, and I can tell you a Joomla Core Hack, or a normal plugin to do that.

But with the plugin, a PDF which could have multiple pages, the second page would not have that logo.

Olaf
Olaf Offick - Global Moderator
learnskills.org

monsterboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Nov 19, 2007 8:32 pm

Re: Get logo in standard print page button

Post by monsterboy » Fri Feb 27, 2009 7:18 pm

I solved everything :)

I just installed a really neat component + handy plugin from Phoca that let me include my own Header for a PDF file, which in my case is an image

This component let you also include your own footer.

If your interested, This is the website : http://www.phoca.cz/phocapdf



Thank you very very much olaf for all your help, your the best! :D

Greetz Monsterboy

Jseb
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Thu Jan 15, 2009 8:32 pm

Re: [SOLVED+Guide] Logo standard in print page button and PDF

Post by Jseb » Thu Mar 26, 2009 3:12 pm

I was wondering i wanna put a logo into this pdf.php file I have this code here
Online 211

Code: Select all

  // Set PDF Header data
  $pdf->setHeaderData('',0,$this->getTitle(), $this->getHeader());
I was just wondering how could i insert a image into it???
Thanks

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11387
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: [SOLVED+Guide] Logo standard in print page button and PDF

Post by ooffick » Thu Mar 26, 2009 3:56 pm

Olaf Offick - Global Moderator
learnskills.org

Jseb
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Thu Jan 15, 2009 8:32 pm

Re: [SOLVED+Guide] Logo standard in print page button and PDF

Post by Jseb » Thu Mar 26, 2009 5:50 pm

Sound k but i putted this code in and gave me this warning

Change code to this

Code: Select all

$pdf->setHeaderData('BandeauTop.png',101.6,$this->getTitle(), $this->getHeader());
Warning

Code: Select all

Warning: fopen(/var/www/webroot/users/10203/levoyageur.ca/public/Joomla/libraries/tcpdf/imagesBandeauTop.png) [function.fopen]: failed to open stream: No such file or directory in /var/www/webroot/users/10203/levoyageur.ca/public/Joomla/libraries/tcpdf/tcpdf.php on line 3717
TCPDF error: Can't open image file: /var/www/webroot/users/10203/levoyageur.ca/public/Joomla/libraries/tcpdf/imagesBandeauTop.png
Origanaly my picture is in 288 pixel but still i change to mm and still doesnt work

Thanks in advance

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11387
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: [SOLVED+Guide] Logo standard in print page button and PDF

Post by ooffick » Thu Mar 26, 2009 6:03 pm

well, you obviously need to put in the right path:
using the relative path to the image.

or put you image in
/var/www/webroot/users/10203/levoyageur.ca/public/Joomla/libraries/tcpdf/imagesBandeauTop.png

Olaf
Olaf Offick - Global Moderator
learnskills.org

Jseb
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Thu Jan 15, 2009 8:32 pm

Re: [SOLVED+Guide] Logo standard in print page button and PDF

Post by Jseb » Thu Mar 26, 2009 6:05 pm

I also try this path here sorry forget to mansion didnt know u were online already thanks for the quick reply

Code: Select all

http://testsite.levoyageur.ca/Joomla/libraries/tcpdf/images/BandeauTop.png
Here the real link to the image and i didnt put the [] around but i still get an erreur

Code: Select all

Warning: fopen(/var/www/webroot/users/10203/levoyageur.ca/public/Joomla/libraries/tcpdf/imageshttp://testsite.levoyageur.ca/Joomla/libraries/tcpdf/images/BandeauTop.png) [function.fopen]: failed to open stream: No such file or directory in /var/www/webroot/users/10203/levoyageur.ca/public/Joomla/libraries/tcpdf/tcpdf.php on line 3717
TCPDF error: Can't open image file: /var/www/webroot/users/10203/levoyageur.ca/public/Joomla/libraries/tcpdf/imageshttp://testsite.levoyageur.ca/Joomla/libraries/tcpdf/images/BandeauTop.png

monsterboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Nov 19, 2007 8:32 pm

Re: [SOLVED+Guide] Logo standard in print page button and PDF

Post by monsterboy » Thu Mar 26, 2009 6:54 pm

Hey,
maybe it would be better to go further on with this subject in a new topic, cause this topic has been solved.

Don't forget to post a link here where you can watch it further on, for those that are searching these forums with the same problem ;)

Thanks in advance, monsterboy

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11387
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: [SOLVED+Guide] Logo standard in print page button and PDF

Post by ooffick » Thu Mar 26, 2009 9:14 pm

Jseb wrote:I also try this path here sorry forget to mansion didnt know u were online already thanks for the quick reply

Code: Select all

http://testsite.levoyageur.ca/Joomla/libraries/tcpdf/images/BandeauTop.png
Here the real link to the image and i didnt put the [] around but i still get an erreur

Code: Select all

Warning: fopen(/var/www/webroot/users/10203/levoyageur.ca/public/Joomla/libraries/tcpdf/imageshttp://testsite.levoyageur.ca/Joomla/libraries/tcpdf/images/BandeauTop.png) [function.fopen]: failed to open stream: No such file or directory in /var/www/webroot/users/10203/levoyageur.ca/public/Joomla/libraries/tcpdf/tcpdf.php on line 3717
TCPDF error: Can't open image file: /var/www/webroot/users/10203/levoyageur.ca/public/Joomla/libraries/tcpdf/imageshttp://testsite.levoyageur.ca/Joomla/libraries/tcpdf/images/BandeauTop.png
Did you you put in the full url in there?

The easiest way would be add in line 211, the BandeauTop.png and then name the image imagesBandeauTop.png and put it in the following folder:
/var/www/webroot/users/10203/levoyageur.ca/public/Joomla/libraries/tcpdf/

But there are obviously many other option.

Olaf
Olaf Offick - Global Moderator
learnskills.org

Jseb
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Thu Jan 15, 2009 8:32 pm

Re: [SOLVED+Guide] Logo standard in print page button and PDF

Post by Jseb » Thu Mar 26, 2009 11:16 pm

Alright this code did the trick

Code: Select all

$pdf->setHeaderData('/BandeauTop.png',101.6,$this->getTitle(), $this->getHeader());


Locked

Return to “General Questions/New to Joomla! 1.5”