So I saw elsewhere on the site how easy it is to load an HTML file and then save it as DOCX (literally 2 lines of code, it seems). But how are image references handled? I’d like the image references in the HTML file to be invoked during the conversion, with the image being included directly in the DOCX file – that way the final product is self-contained and doesn’t need network access to properly view/edit the file. I know this can be done in MS Word U/I with a just a few clicks, but I was wondering how it would be handled programmatically in ASPOSE.
Hi Garth,
Hi Team,
Is there any call back while converting html to word where we can handle images that have custom url in img source (in html) .My requirement is to load these images and put them in html before converting them to word.
@ashu_agrawal_sirionlabs_com Sure, you can use IResourceLoadingCallback to handle external resources loading.
Thanks for the reply.
Can you please guide me the code if I am using document builder approach.
Using documentBuilder.insertHtml('");
@ashu_agrawal_sirionlabs_com Unfortunately, there is no way to pass IResourceLoadingCallback
into DocumentBuilder.insertHtml
. I can only suggest to load HTML into a separate document and then use DocumentBuilder.insertDocument
. In this case upon loading document you can use IResourceLoadingCallback
.