[Skip to main content](#vessel-content)

#   Brand PDF before it can be downloaded

##

- **[klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")**
- [![klimmbimm's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/739-klimmbimm "View klimmbimm's Profile") Topic Author
- [ Offline](/forum/user/739-klimmbimm)

Less More

- Posts: 45
- Thank you received: 2
-
-

14 years 11 months ago -  14 years 11 months ago [\#30146](#30146) by [klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")  *[Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#30146 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")* was created by *[klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")*

I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code: Code:

$document = "test.pdf"; $branding = "Licensed for L. E. Bogen"; brandPDF($document, $branding); function brandPDF($document, $branding) { require_once 'Zend/Pdf.php'; $pdf = Zend_Pdf::load($document); $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); foreach ($pdf-&gt;pages as &amp;$page) { $page-&gt;setFont($font, 12); $page-&gt;drawText($branding, 10, 10); } $pdf-&gt;save('Branded_' . $document); }

How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?

And additionally a probably more PHP affine question:
Very nice would be, if I could relinquish the "save"-function. But I think a download won't be possible without having the file saved first, right?

Last edit: 14 years 11 months ago by [klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

14 years 11 months ago [\#30203](#30203) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#30203 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

Hi,

You can add your code in the function sendFile of the file administrator/components/com_hikashop/classes/file.php

As this is a direct modification of a core file of HikaShop, you will loose the modification when you update HikaShop so please make sure that you backup your modification.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")**
- [![klimmbimm's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/739-klimmbimm "View klimmbimm's Profile") Topic Author
- [ Offline](/forum/user/739-klimmbimm)

Less More

- Posts: 45
- Thank you received: 2
-
-

14 years 11 months ago [\#30270](#30270) by [klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")  Replied by *[klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#30270 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

**nicolas wrote:**

> Hi,
>
> You can add your code in the function sendFile of the file administrator/components/com\_hikashop/classes/file.php
>
> As this is a direct modification of a core file of HikaShop, you will loose the modification when you update HikaShop so please make sure that you backup your modification.

thanks for this information!
do you think the feature is nice enough to be build in in hikashop in some later version? (is there a form for feature requests?)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

14 years 11 months ago [\#30298](#30298) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#30298 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

So far no one else requested such feature. Also, it is really specific to your case and require the zend Pdf library which should be added in HikaShop for that. So I don't think that we would add it.

However, it's a nice idea to trigger hikashop plugins when calling that function so that you can dynamically do some processing on it in a plugin, instead of having to modify a core file. We'll look at adding that in the near future.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")**
- [![klimmbimm's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/739-klimmbimm "View klimmbimm's Profile") Topic Author
- [ Offline](/forum/user/739-klimmbimm)

Less More

- Posts: 45
- Thank you received: 2
-
-

14 years 11 months ago [\#30421](#30421) by [klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")  Replied by *[klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#30421 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

If I would try to put my code in a (hikashop-) plugin, what would I have to do?
Could you recommend me any easy instruction for this?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

14 years 11 months ago [\#30432](#30432) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#30432 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

First, for next release we'll add the code below at the beginning of that sendFile function:
JPluginHelper::importPlugin( 'hikashop' );
$dispatcher =&amp; JDispatcher::getInstance();
$do = true;
$dispatcher-&gt;trigger( 'onBeforeDownloadFile', array( &amp; $file, &amp; $do) );
if(!$do) return false;

that's what will trigger the plugins.

Then, you can create a hikashop plugin, like the plugins which already exist in the folder /plugins/hikashop/ of your website and implement the function onBeforeDownloadFile and put your code there.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")**
- [![klimmbimm's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/739-klimmbimm "View klimmbimm's Profile") Topic Author
- [ Offline](/forum/user/739-klimmbimm)

Less More

- Posts: 45
- Thank you received: 2
-
-

14 years 11 months ago -  14 years 9 months ago [\#30851](#30851) by [klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")  Replied by *[klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#30851 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

thank you, this works great and was fairly easy.

this is my plugin code:

**branding.xml**
see: [ pastebin.com/9iuNE4SC](http://pastebin.com/9iuNE4SC) for better readability

**branding.php**
see [ Pastebin - main part of a Hikashop plugin for branding sold PDFs  ](http://pastebin.com/1Yy8xgKB) for better readability

A few more things:
- I wasn't in the mood to deal with GNU etc. So I removed author and licensing lines from the files. Feel free to use, modify and improve the code. But if you improve, please let me know. ![;-)](/media/kunena/emoticons/24.png ";-)")
- I finally included a reduced Zend Framework for PDF editing in the plugin. So it hasn't to be "installed" seperately.
- **What for is the $do variable?**

Last edit: 14 years 9 months ago by [klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile"). Reason: improved code

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

14 years 11 months ago [\#31365](#31365) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#31365 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

Thank you for sharing your solution.

The $do variable allows you to cancel the download of the file by setting it to false.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mavievs](/forum/user/24180-mavievs "View mavievs's Profile")**
- [![mavievs's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/24180-mavievs "View mavievs's Profile")
- [ Offline](/forum/user/24180-mavievs)

Less More

- Posts: 21
- Thank you received: 1
-
-

13 years 2 months ago [\#121179](#121179) by [mavievs](/forum/user/24180-mavievs "View mavievs's Profile")  Replied by *[mavievs](/forum/user/24180-mavievs "View mavievs's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#121179 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

Does this plugin exist as an easy to install solution? If so, can you please share the plg_.zip file?
thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

13 years 2 months ago [\#121281](#121281) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#121281 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

It's simple. You get the text of branding.xml and branding.php from pastebin and add it in files of the same name. Then, you zip both files together and you will get your installable zip.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mavievs](/forum/user/24180-mavievs "View mavievs's Profile")**
- [![mavievs's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/24180-mavievs "View mavievs's Profile")
- [ Offline](/forum/user/24180-mavievs)

Less More

- Posts: 21
- Thank you received: 1
-
-

13 years 2 months ago [\#121413](#121413) by [mavievs](/forum/user/24180-mavievs "View mavievs's Profile")  Replied by *[mavievs](/forum/user/24180-mavievs "View mavievs's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#121413 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

Thanks for answer, the only problem I face right now is, that it is made for joomla 1.5 - will it work also for joomla 2.5? If not, do you have any idea how to implement this great feature into my hikashop?
thanks

The following user(s) said Thank You: [klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

13 years 2 months ago [\#121513](#121513) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#121513 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

If you want to make it work for joomla 2.5, it requires a few changes in the xml file. I've done it for you:
[ pastebin.com/WgCvKNEK](http://pastebin.com/WgCvKNEK)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mavievs](/forum/user/24180-mavievs "View mavievs's Profile")**
- [![mavievs's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/24180-mavievs "View mavievs's Profile")
- [ Offline](/forum/user/24180-mavievs)

Less More

- Posts: 21
- Thank you received: 1
-
-

13 years 1 month ago [\#121547](#121547) by [mavievs](/forum/user/24180-mavievs "View mavievs's Profile")  Replied by *[mavievs](/forum/user/24180-mavievs "View mavievs's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#121547 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

I am sorry to say that, but I get error during instalation (index.html does not exist) - is there any bug?

thanks a lot for help

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14276
-
-

13 years 1 month ago [\#121567](#121567) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#121567 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

Ah yes, I read the code a bit more. You'll need empty index.html, README_DE and CHANGELOG files in the package, the font calibri.ttf, and the zend framework files in a Zend folder as listed in the xml file.
So it's more complex to do than what I thought first.

The best would be that @klimmbimm provides a zip of what he has done.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")**
- [![klimmbimm's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/739-klimmbimm "View klimmbimm's Profile") Topic Author
- [ Offline](/forum/user/739-klimmbimm)

Less More

- Posts: 45
- Thank you received: 2
-
-

12 years 6 months ago -  12 years 6 months ago [\#151739](#151739) by [klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")  Replied by *[klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile")* on topic *[Re: Brand PDF before it can be downloaded](/forum/4-how-to/30146-brand-pdf-before-it-can-be-downloaded#151739 "I will sell PDFs with my shop products. I would like to have them branded with the customer's username, so I wrote this little PHP code:  How can I include this in Hikashop deftly, so that a customer gets his branded PDF instead of the original file?  And additionally a probably more PHP affine question: Very nice would be, if I could relinquish the &quot;save&quot;-function. But I think a download won't be possible without having the file saved first, right?")*

I am very sorry for the late answer. I was doing a lot of other stuff meanwhile. Tomorrow I hope to get access to a installation zip file, which I will upload then.

Best,

KB

EDIT: Found the zip and merged nicolas' changes to make it officially compatible with Joomla 2.5.
*This attachment is hidden for guests.
Please log in or register to see it.*

To be honest, I didn't share the zip in the past, because I didn't (and still don't) have a clue about copyright stuff. E.g. I am using part of the Zend Framework to write to PDFs and the calibri.ttf.

**REGARDING THE SUPPORTED JOOMLA VERSION:** I am using the plugin with Joomla 2.5. By now, without the changes made by nicolas (thank you!). I guess, it would run under Joomla 3.x as well. Feel free to try and let us know.
**REGARDING THE MISSING INDEX.HTML:** It's like nicolas mentioned before. You need additional files. But you could remove at least calibri.ttf from the listing in the **branding.xml** file, if you like to fiddle around a bit. ![:)](/media/kunena/emoticons/3.png ":)")
Please take care to comment or remove the following line in **branding.php**Code:

$font = Zend_Pdf_Font::fontWithPath(JPATH_BASE . DS . 'plugins' .DS . 'hikashop' . DS . 'branding' . DS . 'calibri.ttf'); // works, if file calibri.ttf is supplied

and uncomment the prepared line above: Code:

//$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); // works without having a TTF font file put in place

Last edit: 12 years 6 months ago by [klimmbimm](/forum/user/739-klimmbimm "View klimmbimm's Profile").

The following user(s) said Thank You: [Xavier](/forum/user/4105-xavier "View Xavier's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzMwMTQ2LWJyYW5kLXBkZi1iZWZvcmUtaXQtY2FuLWJlLWRvd25sb2FkZWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.127 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
