Mark Barto's Blog

Technical Blog about the Microsoft .NET Platform and everything that surrounds it such as .Net, C#, BizTalk, WCF, ASP.NET, SQL, Silverlight, IIS ...

Aspose.Words: Image file cannot be written to disk when using external images

asponse.words

I have a .docx template and have defined some mail merge fields and included an image from the web as link included. When I'm trying to save the document as output for HTML I'm getting the following error:

Image file cannot be written to disk. When saving the document to a stream either Images Folder should be specified or custom streams should be provided via ImageSavingCallback.

 

 

 

This is a bit of strange behavior when using a link to an image which resides on the web because it should not have to save it to disk ? Why must the image be saved to disk when in the .docx template the image linked to a http address because you can use as SRC in the IMG tag this address when converting to HTML ?

The solution after talked to my colleague he pointed me to use the option Link to File when inserting external images.

Capture

You can click on the arrow after the insert button and it will have three options:

  1. Insert
  2. Link to file
  3. Insert and link

The first selection Insert will insert the image and embed it in the document, the second selection Link to file will link to the external address as image and will not embed the image. The third and last option Insert and link will link to the external and also embed the image.

Posted by mabarto on 13-05-2011 Filed under: Aspose.Words



Comments

Commented by omhpbjsk on 16-09-2011
XrNXs5 , [url=http://utfrhfhowigo.com/]utfrhfhowigo[/url], [link=http://mnjrrslvwwle.com/]mnjrrslvwwle[/link], http://vmmgjavsqqva.com/
Commented by Zaylin on 13-09-2011
I was seroiusly at DefCon 5 until I saw this post.
Commented by Jody on 13-09-2011
That's the best awsner of all time! JMHO
Commented by Bubba on 15-09-2011
I love reading these atrciles because they're short but informative.
Commented by mpyopbw on 14-09-2011
emUkmr , [url=http://dfvgectmmwev.com/]dfvgectmmwev[/url], [link=http://osybcztvkvls.com/]osybcztvkvls[/link], http://gcyblukqezji.com/

Leave a comment