I am using Axlsx for generating Excel file.
I need to add image to the Excel File. I have used this code :
ws.add_image(:image_src =>
This looks correct to me as well, and is inline with the example in the gem.
wb.add_worksheet(:name => "Image with Hyperlink") do |sheet|
img = File.expand_path('../image1.jpeg', __FILE__)
# specifying the :hyperlink option will add a hyper link to your image.
# @note - Numbers does not support this part of the specification.
sheet.add_image(:image_src => img, :noSelect => true, :noMove => true, :hyperlink=>"http://axlsx.blogspot.com") do |image|
image.width = 7
image.height = 6
image.hyperlink.tooltip = "Labeled Link"
image.start_at 2, 2
end
end
There is a possibility that a bug was introduced in the version you are using.
As we discussed on #axlsx, lets try this against master on github and if it does prove to be a bug in the version you are using, I'll push out a new release.
Best,
randym