在pdfsharp html中使用base64图像进行pdf转换

时间:2017-02-21 22:00:45

标签: c# image pdf base64 pdfsharp

我试图在HTML中嵌入base64图像,然后将其转换为PNG,正常图像工作正常但如果我将src设置为base64字符串则在我的pdf中显示损坏的图像:

https://gyazo.com/7c86e05373b165840225e931cf5975c9

这是我要发送的图像字符串的示例,在html中正常工作,在转换为pdf后损坏。

<img id="fmacttcChartPNG-PullUps" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAgMAAACd/+6DAAAAAXNSR0IArs4c6QAAAAlQTFRF7QA07QA0////wRtPhQAAAAF0Uk5TAEDm2GYAAAABYktHRAJmC3xkAAAACW9GRnMAAAORAAAJpwDTb3gUAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH4AoEBBQC2OsgcQAAABBJREFUCNdjYIAC1lDsGAgAIgICHfAWayEAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTYtMTAtMDRUMDQ6MjA6MDIrMDI6MDAcnXh7AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE2LTEwLTA0VDA0OjIwOjAyKzAyOjAwbcDAxwAAACl0RVh0ZGM6Zm9ybWF0AGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3DkrZ9UAAAAOHRFWHRpY2M6Y29weXJpZ2h0AENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueflXeTcAAAAhdEVYdGljYzpkZXNjcmlwdGlvbgBzUkdCIElFQzYxOTY2LTIuMVet2kcAAAAmdEVYdGljYzptYW51ZmFjdHVyZXIASUVDIGh0dHA6Ly93d3cuaWVjLmNoHH8ATAAAADd0RVh0aWNjOm1vZGVsAElFQyA2MTk2Ni0yLjEgRGVmYXVsdCBSR0IgY29sb3VyIHNwYWNlIC0gc1JHQkRTSKkAAAAYdEVYdGxhYmVsAFJlY3RhbmdsZSA4IGNvcHkgMsSFowcAAAAVdEVYdHBob3Rvc2hvcDpDb2xvck1vZGUAM1YCs0AAAAAmdEVYdHBob3Rvc2hvcDpJQ0NQcm9maWxlAHNSR0IgSUVDNjE5NjYtMi4xHC9sCwAAABN0RVh0dGlmZjpYUmVzb2x1dGlvbgA3Mg5QcYUAAAATdEVYdHRpZmY6WVJlc29sdXRpb24ANzKTX5DzAAAAKHRFWHR4bXA6Q3JlYXRlRGF0ZQAyMDE2LTA5LTIwVDIyOjEyOjEwKzA1OjAwdPNMtwAAADF0RVh0eG1wOkNyZWF0b3JUb29sAEFkb2JlIFBob3Rvc2hvcCBDQyAyMDE0IChXaW5kb3dzKTJLJSkAAAAqdEVYdHhtcDpNZXRhZGF0YURhdGUAMjAxNi0wOS0yOFQyMzo0OTo0OSswNTowMAbjefgAAAAodEVYdHhtcDpNb2RpZnlEYXRlADIwMTYtMDktMjhUMjM6NDk6NDkrMDU6MDA6RypGAAAAS3RFWHR4bXBNTTpEb2N1bWVudElEAGFkb2JlOmRvY2lkOnBob3Rvc2hvcDozNjQ2ZDY3ZC03ZjVkLTExZTYtYmMwYS1jMjA1ZmMxYjZiNmKXgewtAAAAPXRFWHR4bXBNTTpJbnN0YW5jZUlEAHhtcC5paWQ6ZWI5ZTBjYzQtOTVlMy05NjQ3LWI5Y2QtNDcyOGVjMzBhNTc0GfVhRwAAAEV0RVh0eG1wTU06T3JpZ2luYWxEb2N1bWVudElEAHhtcC5kaWQ6OGM1NTVkNDMtNDM2MC1hZTQ5LWJkMGMtZjkyY2E0MWY5MzUxLlI9uAAAAABJRU5ErkJggg==">

是否有人知道这是否受到支持或对正确的方向有任何想法继续进行此操作?

谢谢,

萨姆

0 个答案:

没有答案