我正在一个基于 nodejs 的项目中工作,该项目需要将“wmf”转换为“png”格式。由于浏览器不支持“wmf”格式。因此,我需要编写代码将其转换为 nodejs 中等效的“png”格式img 标签。例如,图像当前表示为:
<img src="data:image/x-wmf;base64,AQAJAAADcAEAAAIAlgAAAAAABQAAAAIBAQAAAAUAAAABAv///wAFAAAALgEZAAAABQAAAAsCAAAAAAUAAAAMAkACYAQLAAAAJgYPAAwATWF0aFR5cGUAAHAAEgAAACYGDwAaAP////8AABAAAADA////rf///yAEAADtAQAABQAAAAkCAAAAAgUAAAAUArsBSgEcAAAA+wIA/wAAAAAAAJABAAAAAAACABBUaW1lcyBOZXcgUm9tYW4ALMXLAHlIJ3ZAkSp2GRpmSQQAAAAtAQAADQAAADIKAAAAAAQAAAAyKFMpkwFYAJAAAAIFAAAAFAJgATsAHAAAAPsCoP4AAAAAAACQAQAAAAAAAgAQVGltZXMgTmV3IFJvbWFuACzFywB5SCd2QJEqdhkaZkkEAAAALQEBAAQAAADwAQAACgAAADIKAAAAAAIAAABIT5wBwAKWAAAAJgYPACEBQXBwc01GQ0MBAPoAAAD6AAAARGVzaWduIFNjaWVuY2UsIEluYy4ABQEABwFEU01UNwAAE1dpbkFsbEJhc2ljQ29kZVBhZ2VzABEFVGltZXMgTmV3IFJvbWFuABEDU3ltYm9sABEFQ291cmllcjEwIEJUABEETVQgRXh0cmEAEgAIIR8o8m8iDyFfIR8hHyHwHkFQ9BUPQQD0RfQl9I9CX0EA9BAPQ19BAPSPRfQqX0j0j0EA9BAPQPSPQX9I9BAPQSpfRF9F9F9F9F9BDwwBAAEAAQACAgIAAgABAQEAAwABAAQAAAoBAAIAg0gAAwAbAAALAQACAIgyAAABAQAKAgCDTwADABsAAAsBAAIAgigAAgCDUwACAIIpAAABAQAAAHQKAAAAJgYPAAoA/////wEAAAAAABwAAAD7AhAABwAAAAAAvAIAAAAAAQICIlN5c3RlbQBJGRpmSQAACgA4AIoBAAAAAAAAAACYz8sABAAAAC0BAAAEAAAA8AEBAAMAAAAAAA==" />
此外,客户端服务器是基于 Linux 的。所以“wmf2png”npm 包不起作用。由于图像是内联的并且没有存储为单独的“*.wmf”文件,因此像“libwmf”这样的 npm 包似乎不起作用。
那么有什么方法可以转换这样的图像并以等效形式表示?