We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Insert HTML with base64 PNG Image Data String in Word Document | C# .NET

I’m using a DocumentBuilder to create a word document. It has a few tables. In one cell, I am trying to insert the value from a database table. It works when the data is html text only.
For some reason, I get an error when I try with a record that has a base64/png string.

The string is fine as the content correctly displays elsewhere in html view on another page.

The text starts with: <p><img src="data:image/png;base64,iVBOR

Is anyone able to shed some light on why this is not working?

I’m using Aspose version



You are using a very old (15.5.0) version of Aspose.Words for .NET on your end. We suggest you to please upgrade to the latest (21.8) version of Aspose.Words for .NET and see how it goes on your end? In case the problem still remains, then please compress the following resources into ZIP format and attach the .zip file here for further testing on our end:

  • Your simplified source Word document
  • The problematic HTML string containing the Base64 PNG data you are getting this “Invalid length for a Base-64 char array or string.” problem with