Hi,
I need to export image in headers, and used base64 value of the image. But it is not getting rendered in the exports header.
Please check the below code and attachment for the image.
HTML:
<img style="height:45px;width:45px;"
src="data:image/png;base64,Li4vLi4vLi4vLi4vLi4vYXNzZXRzL2ltYWdlcy9wcmludC5wbmc="></div>
Base64 Conversion:
getCompanyLogoImageBase64(): any {
this.Base64Url = null;
const file = new Blob(['../../../../../assets/images/print.png']);
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => {
this.Base64Url = (reader.result).toString();
console.log('this.Base64Url', this.Base64Url);
return this.Base64Url;
};
reader.onerror = () => {
return this.Base64Url;
};
}
Please check the conversion whether it is appropriate or not and provide any solution to render the image in export headers.
Regards,
Ravi
Hi Ravi,
Since base64 image encoding is not provided as a part of Flexmonster functionality, we can provide you with a couple of suggestions we have found on the web instead:
We hope this helps.
Best regards,
Mykhailo
Hi Mykhailo,
Thanks for the quick response.
Please provide any relevant example how to export image in headers, so that we can convert image to Base64 and will try to export.
Regards,
Ravi
Ravi,
Please see the following sample illustrating how to export an image with a ready-to-use base64 string: https://jsfiddle.net/flexmonster/hw2qtc1k/
We hope this helps.
Regards,
Mykhailo
Hi Mykhailo,
Thank You, above solution helped us to solve.
Regards,
Ravi