.Net Core 遇到 “'windows-1252' is not a supported encoding name.”


最近用 iTextSharp 拆分 Pdf 文檔

加水印的時候遇到錯誤:

'windows-1252' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
Parameter name: name


需要在 NuGet 里添加 System.Text.Encoding.CodePages

image


然后在程序里注冊下就可以了

Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);


iTextSharp 還是很好用的

就是不能 Pdf 轉圖片或生成縮略圖…


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM