I have been trying out PhpSpreadsheet, and so far it's working well. However, I'm stuck on adding an image to the spreadsheet. In my database, I have both external image URLs (ex: http://somewhere.com/imagename.png) and base64 image data. Is it possible to display these as images in the spreadsheet?
Asked
Active
Viewed 2,340 times
0
-
Did you check this: https://phpspreadsheet.readthedocs.io/en/develop/topics/recipes/#add-a-drawing-to-a-worksheet – Alberto Sep 06 '18 at 13:47
-
Yes, definitely. However, the path appears to be a local path: $drawing->setPath('./images/officelogo.jpg'); I would like to do this with external URLs and base64 image data. – Meowntain Sep 06 '18 at 14:07
-
1Have you tried that code linking an external image? If it doesn't work, try getting the image in base64 and storing it somewhere in a tmp folder. – Alberto Sep 06 '18 at 14:21
-
I tried linking to an external image, but I got an "image not found" error. I ended up saving the image in a temp folder and referencing it locally. Thanks! – Meowntain Sep 07 '18 at 12:27