We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

I'm asking if EJ2 can print webpages using ejPrint() like EJ1.

Hello.

I'm currently migrating from EJ1 to EJ2.
In the case of EJ1, the sub contents of a specific tag were printed out by using ejPrint(). In EJ2, I would like to ask you whether there is no such function.

----------------- Example of outputting a specific tag using EJ1 -----------------------
    var print = $("#DashboardDIV").clone();
    print.append("<script>document.body.style.backgroundColor = 'white'<\/script>");
    print.ejPrint();
-------------------------------------------------- -------------------------------------------------- --------------
Please ask if EJ2 can be used as above.
(The component is not a Dialog but I chose it as a required input.)

Thank you.

5 Replies

JA Jesus Arockia Sankaran S Syncfusion Team January 23, 2020 04:29 PM UTC

Hi jeongkyu, 

Yes, EJ2 can print the webpages like ejPrint() in EJ1. It can be achieved by using print() method. By using the print method you specify the print content element and print window. We have prepared a sample for your reference. Please find the sample below. 


Regards, 
Jesus Arockia Sankaran S 



JP jeongkyu park January 28, 2020 05:14 AM UTC

Thank you for the answer.

Is it possible to use javascript instead of typescript?
I am working with EJ2 javascript.


JA Jesus Arockia Sankaran S Syncfusion Team January 28, 2020 07:05 AM UTC

Hi jeongkyu, 

Thanks for your update. 

We have created a sample in JavaScript for your reference that you can find from the link below. 


Regards, 
Jesus Arockia Sankaran S 



JP jeongkyu park January 28, 2020 09:34 AM UTC

Just confirmed that it works!

Thank you. Jesus Arockia Sankaran S


JA Jesus Arockia Sankaran S Syncfusion Team January 28, 2020 09:35 AM UTC

Hi jeongkyu, Thanks for the update.

Loader.
Up arrow icon