简体   繁体   English

Asp.Net:将PDF转换为图像

[英]Asp.Net : Convert PDF to Image

I have a pdf file in a base64 string format. 我有一个base64字符串格式的pdf文件。 I need to convert it to an image (any type) to use further in my code. 我需要将其转换为图像(任何类型)以在代码中进一步使用。 I have searched SO as well as the web and I have not been successful with anything. 我已经搜索了SO和网络,但没有成功。
Does anyone have a tried and true method for this? 有人对此有尝试过的真实方法吗?

I can use a third party. 我可以使用第三方。 I just need a working one!! 我只需要一个工作的人!

Thank you 谢谢

base64 is the form of string web friendly representation of byte array. base64是字节数组的字符串Web友好表示形式。 you may convert it to a byte array like this: 您可以将其转换为byte array如下所示:

byte [] decodedBytes = Convert.FromBase64String (encodedText);

then you may simple save it to a file: 那么您可以简单地将其保存到文件中:

System.IO.File.WriteAllBytes("file.pdf", decodedBytes);

and then finally convert pdf to image 然后最终将pdf转换为图像

I used the Apitron PDf Rasterizer to convert my file. 我使用Apitron PDf光栅转换器转换文件。 It is very simple to use and works great. 使用非常简单,效果很好。 No missing dlls and clear documentation. 没有丢失的dll和清晰的文档。 However, you do need to purchase it. 但是,您确实需要购买。
Thanks to all for assistance 感谢大家的帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM