# how to add store link in invoice pdf magento

how can I add store link in invoice pdf under logo in magento 1.9

## 1 Answer

One way to do that:

You should rewrite Mage_Sales_Model_Order_Pdf_Invoice class, and provide your own `insertLogo()` method

This is the original, in Mage_Sales_Model_Order_Pdf_Abstract abstract class

``````protected function insertLogo(&\$page, \$store = null)
{
\$this->y = \$this->y ? \$this->y : 815;
\$image = Mage::getStoreConfig('sales/identity/logo', \$store);
if (\$image) {
\$image = Mage::getBaseDir('media') . '/sales/store/logo/' . \$image;
if (is_file(\$image)) {
\$image       = Zend_Pdf_Image::imageWithPath(\$image);
\$top         = 830; //top border of the page
\$widthLimit  = 270; //half of the page width
\$heightLimit = 270; //assuming the image is not a "skyscraper"
\$width       = \$image->getPixelWidth();
\$height      = \$image->getPixelHeight();

//preserving aspect ratio (proportions)
\$ratio = \$width / \$height;
if (\$ratio > 1 && \$width > \$widthLimit) {
\$width  = \$widthLimit;
\$height = \$width / \$ratio;
} elseif (\$ratio < 1 && \$height > \$heightLimit) {
\$height = \$heightLimit;
\$width  = \$height * \$ratio;
} elseif (\$ratio == 1 && \$height > \$heightLimit) {
\$height = \$heightLimit;
\$width  = \$widthLimit;
}

\$y1 = \$top - \$height;
\$y2 = \$top;
\$x1 = 25;
\$x2 = \$x1 + \$width;

//coordinates after transformation are rounded by Zend
\$page->drawImage(\$image, \$x1, \$y1, \$x2, \$y2);

\$this->y = \$y1 - 10;
}
}
}
``````

You can use `\$page->drawText(\$text, \$x, \$y);` method for your customization. This method requires \$text as first parameter, and then \$x & \$y coordinates, as second & third parameters. You'll get how coordinates work after a little play

• Thanks, but i want to add link with home page url. like: < a href='site url' > Click < / a > – Waqar Jan 17 '18 at 10:31
• Yeah, you want to add a text under the logo, doesn't it? – Raul Sanchez Jan 18 '18 at 7:20
{"ft_lang_label":"__label__en","ft_lang_prob":0.64350694,"math_prob":0.9340042,"size":1879,"snap":"2021-04-2021-17","text_gpt3_token_len":571,"char_repetition_ratio":0.1296,"word_repetition_ratio":0.048611112,"special_character_ratio":0.33741352,"punctuation_ratio":0.18153846,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9647231,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-04-19T00:26:52Z\",\"WARC-Record-ID\":\"<urn:uuid:087c3edc-ab42-45df-85f3-0a67049fbce4>\",\"Content-Length\":\"164510\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:97c7ad8d-baba-4dcc-bbac-cd7ef5420da5>\",\"WARC-Concurrent-To\":\"<urn:uuid:76294ca7-ee7c-43bc-a5c1-996035911c5d>\",\"WARC-IP-Address\":\"151.101.1.69\",\"WARC-Target-URI\":\"https://magento.stackexchange.com/questions/209742/how-to-add-store-link-in-invoice-pdf-magento\",\"WARC-Payload-Digest\":\"sha1:ADA6EMXTIHBMYDVXX2KB2WTBBZE4QXKI\",\"WARC-Block-Digest\":\"sha1:ETIR7QKFVIE5YO6IBL73YAFWIJ6DBWY6\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-17/CC-MAIN-2021-17_segments_1618038862159.64_warc_CC-MAIN-20210418224306-20210419014306-00373.warc.gz\"}"}