How to Skip Images while Importing HTML into Aspose.Words' DOM using .NET

We are using aspose to import a word file from our customers where we parse the content to html. All the images inside the document are uploaded and their corresponding url’s are inserted on each image using Shape.ImageData.SourceFullName.
The problem comes when we save the document to html, it seems like all the images are downloaded which causes the document to take several seconds to finish saving.
Is there a way to avoid that? We basically just need to insert an url instead of an image, I dont understand why the images need to be downloaded before saving.

Hello again,
I stumbled upon the solution here:
https://reference.aspose.com/words/net/aspose.words.loading/loadoptions/resourceloadingcallback/
You can set ResourceLoadingAction.Skip on Images and aspose won’t download the image when you try to save the document, this just saved me 6-7 seconds on one of our worst document examples

If you are trying to modify the image’s url check my comment above

@criaraci
criaraci:

You can set ResourceLoadingAction.Skip on Images and aspose won’t download the image when you try to save the document, this just saved me 6-7 seconds on one of our worst document examples

It is nice to hear from you that you have found the solution of your query. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.

1 Like