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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to export Grid or Hierarchy grid to pdf inside code

Thread ID:

Created:

Updated:

Platform:

Replies:

148135 Oct 7,2019 07:13 PM UTC Oct 21,2019 12:25 PM UTC React - EJ 2 9
loading
Tags: Grid
Albert
Asked On October 7, 2019 07:13 PM UTC

As we need to have a image  file of the report in order to print on Esc-pos printers and exporting to image is not possible , we are going to export the report to pdf file located in specific directory programatically  and then change it to jpg format.

I would appreciate to have a sample code for this.

Thanks in advance

Thavasianand Sankaranarayanan [Syncfusion]
Replied On October 8, 2019 01:28 PM UTC

Hi Afshin, 

Greetings from Syncfusion support. 

Based on your query we suspect that you want to export hierarchy Grid and we have already discuss about this query in the following documentation. 


If we misunderstood your query then please get back to us. 

Regards, 
Thavasianand S. 


Albert
Replied On October 8, 2019 07:51 PM UTC

No its not the same query.

This is the requirement. we have a syncfusion grid that we show customer order inside that and we have a div showing order summary. we are going to print them on Esc-pos printer . in order to print we have to prepare an image containing the div and the grid. we have an export to pdf button that user can export the grid. my question in this : how can we do export to pdf programaticaly in order to convert it to image.

If its not possible do you have other solution in mind like having html of the grid in order to convert it to image?

Thanks

Thavasianand Sankaranarayanan [Syncfusion]
Replied On October 9, 2019 10:58 AM UTC

Hi Albert, 

Thanks for explaining about your requirement. 

We have validated your requirement. If your requirement was to print the grid element as image you can use Print feature of the Grid which allows you print the grid element as image. If it is not possible in your case please explain about the difficulty you are facing, that will help us to provide a better solution as soon as possible. 

If possible, please share the screenshot or video demo of the Grid that you need to print. 

Refer the following documentations and demo links for more information. 



Regards, 
Thavasianand S. 


Albert
Replied On October 9, 2019 04:25 PM UTC

The problem is this . As we are going to print on android device and using Esc-pos printer, using the print button will not print on android device and just prints on windows devices .We have a printer library that we have to pass the image of the report to it and it prints based on different esc-pos printers.

What we need is to get the image of the report ( grid to print ) programatically.

Thanks

Thavasianand Sankaranarayanan [Syncfusion]
Replied On October 11, 2019 01:45 PM UTC

Hi Afshin, 

By default, In our EJ2 Grid is purely web component(HTML, CSS and JavaScript) and its printing feature perform web page printing not windows, ESC Pos printing seems to print like emulator printing(window console or c program or other emulators). 

If possible can you please create a simple HTML sample and check with ESC printer and share the sample and details with us that will helpful for us to analyze further and helps to integrate with our grid. 

Regards, 
Thavasianand S. 


Albert
Replied On October 11, 2019 02:04 PM UTC

Thanks for your answer.

As you mentioned printing on Esc-pos printers is not possible through html pages and the printer company has provided a library that gets an image file and prints it.

For that reason we are looking for a way to have an image of what is going to be printed to pass to their library.

It would be the best for us to get the image of what is going to be printed from you otherwise we need a pdf or html of that in order to convert it to image programatically.

Thanks again

Thavasianand Sankaranarayanan [Syncfusion]
Replied On October 15, 2019 09:28 AM UTC

Hi Albert, 

Thanks for your update. 

In  EJ2 Pdf Viewer sever library (ASP.NET Core and Asp.NET MVC) allows the PDF document pages to be exported as raster images. We have created a sample to export the PDF document pages as image using PDF Viewer server library and shared in the following location, 


Note: In above sample, we have created Windows, Linux and IOS project files (with their respective packages). So kindly build the windows project when working in windows environment.   

Please find the below UG links for reference,  

   

Regards, 
Thavasianand S. 


Albert
Replied On October 18, 2019 06:37 PM UTC

Hi Thavasianand,

Thanks a lot for your advice.

Is it possible for your team to prepare the same for React.js as we are not using asp.net.

Thanks 

Thavasianand Sankaranarayanan [Syncfusion]
Replied On October 21, 2019 12:25 PM UTC

Hi Afshin, 

We do not have support to export the PDF document pages into images from React front end. As mentioned earlier we can export the PDF document pages into images only using our EJ2 Pdf Viewer sever library. 

Regards, 
Thavasianand S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon