Insert a link to an image

Hi, I am using your product version 4.1.2.0. I would like to insert a link to an image.
My code so far:
int pictureIndex = sheet.Pictures.Add(startRow, 0, Properties.Localization.ResourceManager.GetStream(“blank”));
Aspose.Cells.Picture picture = sheet.Pictures[pictureIndex];
now I’d like to do picture.URL = “http://myaddress.com”, so that the picture is downloaded every time the document is opened.

This currently can be done in Word and Pdf using the Url property of the Picture object. Is there a workaround or could you please add this feature to the Cells library?

Thank you!
Sincerely
Filipp Rakevich

Hi,

Since you are using some older version of the product for which I am not sure if this feature was available in that version (you may check by yourself). This is feature is already available in the new versions obviously, I have attached the latest version/fix so that you give it a try (if the feature is not available in your version). For reference, see the document/article: http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/add-image-hyperlinks.html


Thank you.

Thank you very much for your quick response. The new dll does have many more useful properties then the old one. But the feature of making the image a hyperlink is not what I had in mind. I am looking to be able to specify an image as a placeholder with its address pointing to a picture on the internet. Something like: picture.URL = “http://mysite.com/picture.jpg”. Then when excel opens it would download the picture from the internet every time (not just once), so that we could dynamically control what the picture looks like over time. This can be achieved in excel by doing a regular ‘insert picture’ and then selecting ‘add as a link’. This feature is currently implemented in aspose.Word.
Thank you

Hi,

Could you check the document if this can fulfill your requirement?
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/load-a-web-image-from-a-url-into-an-excel-worksheet.html


Thank you.

Hi, thank you, but I have previously seen this article. I want to reiterate that what I am looking for is not inserting an image from stream, but have an image object that will point to an image on the web, just like it is currently done in the aspose.Word. This image is not physically embeded into the excel document, but rather points to a web resource, thus it is downloaded fresh every time the document is opened.

This is how it works in Word:
MemoryStream ms = new MemoryStream(docBytes, true);
Document doc = new Document(ms);
DocumentBuilder builder = new DocumentBuilder(doc);

//Create shape
Aspose.Words.Drawing.Shape shape = new Aspose.Words.Drawing.Shape(doc, Aspose.Words.Drawing.ShapeType.Image);

//Set paht to the linked image
shape.ImageData.SourceFullName = “http://mysite.com/getImage.aspx”;

//Set size of the image
shape.Height = 1;
shape.Width = 1;

//Inset image into the docuemnt
builder.InsertNode(shape);

//Save output document
doc.Save(output, docType == DocumentType.Docx ? SaveFormat.Docx : SaveFormat.Doc);

Hi,

Please try the attached version.

We have supported to add a linked image with the method Shapes.AddLinkedPicture(int upperLeftRow, int upperLeftColumn, int heightPixels, int widthPixels,
string sourceFullName).

See the following sample code:

Workbook workbook = new Workbook();
workbook.Worksheets[0].Shapes.AddLinkedPicture(0,0,100,100,"http://www.aspose.com/Images/aspose-logo.jpg");
workbook.Save(@“F:\FileTemp\dest.xls”);

Moreover, your feature request was logged into our internal issue tracking system with an issue id: CELLSNET-11594. We will wait for your feedback to test the feature for your requirement.

Thank you.

Hi, I am extremely impressed with the speed with which you have added this feature! Thank you!!!

The only thing is that I am getting evaluation version excel content, even though I set the license. We have the Total license, I believe it covers the Cells product as well. Does the license need to be set differently with Cells?

Thank you
Filipp

Hi,

Thank you for considering Aspose.

I think your license “Aspose.Total.lic” might be expired to use the latest versions/fixes of Aspose.Cells for .NET. For your information, any of the fixes / new releases will work fine unless your license is not expired (license expiry date can be seen in the license file opening the license file into notepad). You may use our latest version 4.8.0.x if your subscription allows this, you may open your license file into notepad and check the expiry date. When you purchase the license, you are eligible to use versions / bug fixes of the products that are released in the next whole year. But if a version/fix is released after your subscription expiry, you need to upgrade your subscription then.

So, could you check your subscription expiry date. If this is not the case, you can send the license file via email. Please check the steps how you may post your license file to us: http://www.aspose.com/corporate/purchase/faqs/send-license-to-aspose-staff.aspx


Thank you.


Hi,

Please check my previous reply in the thread for your issue. Also, see the document on how to set license file in code: http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/licensing.html

Thank you.

The issues you have found earlier (filed as 11594) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi, it works fine with xls file, but doesn’t work with xlsx file. I tryed to use FileFormatType.Excel2007Xlsx when I create new instance, but it doesn’t help me.
Could you tell me how can I solve this.
Thank you.

Hi,

Yes, I am afraid, currently the feature (Add Linked picture) is available for Xls (Excel 97 - 2003) format.

We have logged your feature request (Support for xlsx format in adding linked images feature) into our issue tracking system with an issue id: CELLSNET-13536. We will update you soon.

Thank you.

Hi,

Please try the attached version, we have supported the feature.

Thank you.

I am currently evaluating your product. I tried to use AddLinkedPicture() for an .xlsx file - it did not work. It did work for an .xls file. Your patch zip file is 3 years old so probably not compatible with current products. Is .xlsx still not supported in your delivered product - or is there some trick I need to use.

Hi,


I have tested your scenario / case using the code shared in the article with our latest fix/version : Aspose.Cells for .NET v7.5.2 :
http://www.aspose.com/docs/display/cellsnet/Insert+a+Linked+Picture+from+Web+Address
it works fine for XLSX file format.

Thank you.