Free Support Forum - aspose.com

Covert Sheet to Image

Hi, I would like to convert entire spreadsheet to image and insert to a new sheet (in order to protect data). I did some quick investigation and found following …


However I cannot find example code …
Do you offer this functionality?

Thanks,
Catalina

@catalparue,

Yes, it is easier to accomplish the task. Your task has two parts.
Part1
i) Convert your desired sheet to image using OnePagePerSheet Boolean attribute. This will work if your sheet is not very big (has 3/4 pages or less than 10 pages, etc.). See the example code (to domenstrate OnePagePerSheet option) in the document for your reference.
ii) If your worksheet is large, then you may refer to the example in the document that shows how to use Aspose.Cells to convert a worksheet that has several pages to render one image file per sheet page.
(please note, you may change the ImageType to “PNG”, “EMF” or “JPEG”, if you do not want images in “TIFF” format)

Part 2
Once you render image(s) in Part1, then you may add the generated/rendered pictures to your desired sheet accordingly. See the document on how to add pictures in a worksheet for your reference.

Hope, this helps a bit.

hi, our sheet is large. Hence I tried your solution refer to ’ Convert Worksheet to Image by page’ (https://docs.aspose.com/cells/net/converting-worksheet-to-image-and-worksheet-to-image-by-page/#convert-worksheet-to-image-by-page)
however, in the end of the function there is no image saved in the target folder. Is there anything I missed? is the example code saving any of the image in the end?

@catalparue,

The issue might be due your code you wrote in your project/application. Also, please make sure you have specified the target folder ok in your code. If you still find any issue, kindly do create a separate console demo application (runnable), zip the project (exclude Aspose.Cells Dll to minimize the size of the project) with all the resource files and post us here, we will check and assist you to update your code segment accordingly soon.

cool! that works! I think the image generation is very slow. Hence wait for a couple of mins that we can see image.

@catalparue,

Good to know that your issue is now resolved. In the event of further queries or issue, feel free to write us back.