xou / elixlsx

An Elixir XLSX writer
MIT License
293 stars 116 forks source link

Images - oneCellAnchor #135

Open krishandley opened 1 year ago

krishandley commented 1 year ago

Thanks to @ngscheurich and @joseustra for the previous on trying to get images working.

124 by was using twoCellAnchor but that needed more details

which were not very easy to perfect with the variable max character width for different fonts and font sizes.

This is now using a oneCellAnchor to make the calculations much simpler.

I added an option to align the image from the right of a cell. That's something I needed but you also have to take the max character width into account.

I also fixed the formula because it didn't work in the example file.

Edit: Forgot I also added font + font_size options to the workbook

Screenshot