1

I have an XLS file an I need to export an area from that as image, like A1:K15 I want to do that with PHP I'm already using PHPExcel to read/write spreadsheets but i've no idea if it is possible somehow with that. Any idea?

  • You will have to create an image yourself using PHP Functions. Try this : http://www.php.net/manual/en/book.image.php – Karan Sharma May 12 '17 at 06:51

1 Answers1

1

There are some options :

  1. If you work with Windows Server, and you can install Excel on the Server - So you can open Excel as "COM" , and then export your range.
  2. Same as 1 - but do it with VBS file, that will connect to Excel , and not directly to Excel - it is the same sytax like VBA, so you can see example here.
  3. Microsoft offer EWA - Excel Web Access , and in their API - their is an option to save range as image - exactly what you wanted , but the excel file need to hosted in Microsoft Sharepoint Online ( or SharePoint On Permise)
  4. By PHPExcel - export to Html, and after that convert the html to image by wkhtmltoimage - it is command line tool that is part of wkhtmltopdf.

If PDF is ok, you can use PHPExcel - To export to PDF

Community
  • 1
  • 1
user1598814
  • 732
  • 9
  • 10