Base64在C#中编码PDF? [英] Base64 Encode a PDF in C#?
本文介绍了Base64在C#中编码PDF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
使用 File.ReadAllBytes
加载PDF文件,然后使用 将字节数组正常编码Convert.ToBase64String(bytes)
。
Can someone provide some light on how to do this? I can do this for regular text or byte array, but not sure how to approach for a pdf. do i stuff the pdf into a byte array first?
解决方案
Use File.ReadAllBytes
to load the PDF file, and then encode the byte array as normal using Convert.ToBase64String(bytes)
.
这篇关于Base64在C#中编码PDF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文