Converting screenshot to base64 and saving it as HTML file

Am trying to save the screenshots in base64 and embed them in the HTML file.

However I m not able to succeed with the result, all I can see is broken image in the browser (.html)

Screenshot file is working, in the log can see the base64 string but the output string is still broken,

I tested the file size which is lesser than 5kb in both PNG and JPEG format.

The following steps were used

  1. Screenshot image file is ready by byteArray =System.IO.File.ReadAllBytes(“Filepath”)
  2. Byte Array is converted to Base64 Convert.ToBase64String(byteArray)
  3. HTML is constructed using Base64String values -

<img src=“data:image/png;base64,”+base64String/>

  1. Base64String value is Mapped into the Create HTML content activity
  2. Using write file, the html output is saved as .html file.

Hi,

Can you try the following sample?

Sample
Sample20231010-2aL.zip (8.2 KB)

Regards,

1 Like

@Hari

Can you please how a screenshot of your create html content

becaue there should be a leading and trailing inverted comma

<img src="data:image/png;base64,324u324..32423">

if with variable should looke like this

"<img src=""data:image/png;base64," + str + """>"

cheers

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.