Display image before printing

Hi,

how can I display an image before printing the grid, I've tried putting a div and an img tag from javascript, but I am receiving an error.




1 Reply

RR Rajapandi Ravi Syncfusion Team October 13, 2021 12:34 PM UTC

Hi Tarik, 

Greetings from Syncfusion support 

From your update, we could see that you like to insert the image in the print document. Based on your query we have prepared a sample and achieved your requirement by using beforePrint event of Grid. Please refer the below code example and sample for more information. 


<script> 
    function beforePrint(args) { //beforePrint event of Grid 
        var image = document.getElementById('image').cloneNode(true); 
        image.style.display = "block"; 
        args.element.prepend(image); 
    } 
</script> 



Screenshot: 

 

Regards, 
Rajapandi R 


Loader.
Up arrow icon