Jump to content

Recommended Posts

Posted

i'm writing a component to display invoice in html format , almost done and work like a charm .

what i need is to use the inoice logo if set displayed in my html page , ny quick code to include id in my template invoice ?

what i have as solution , is copy the logo into a temp directory and use it .

Posted

maybe an inspiration from here:

 

in /app/views/client/bootstrap/structure.pdt   & line 51

<div class="logo">
					<a href="<?php echo $this->Html->safe($this->base_uri);?>">
						<?php
						if (!empty($theme_logo)) {
						?>
							<img src="<?php $this->Html->_($theme_logo);?>" alt="Logo" />
						<?php
						}
						elseif (!empty($blesta_logo)) {
						?>
							<img src="<?php $this->Html->_($blesta_logo);?>" alt="Blesta" />
						<?php
						}
						else {
						?>
							<img src="<?php echo $this->view_dir;?>images/logo.png" alt="Blesta" />
						<?php
						}
						?>
					</a>
				</div>
Posted

thanks serge , but this is not what i want or this methode is impossible with my request . the invoice template system didn't accept the base_uri var , also note that the upload directory is out side the public html .

but anyway i have found tip that is working for me , i convert the image to the base_64 code and i use it in the img tag . so if anyone want the same thing this is the working solution

$type = pathinfo($this->meta['logo'] , PATHINFO_EXTENSION);
$data = file_get_contents($this->meta['logo']);
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);

$buffer = '<h1><img src="'. $base64 .'"></h1>';

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...