最近用 iTextSharp 拆分 Pdf 文档加水印的时候遇到错误:windows-1252 is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvid...

最近用 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
然后在程序里注册下就可以了
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
iTextSharp 还是很好用的
就是不能 Pdf 转图片或生成缩略图…
本文标题为:.Net Core 遇到 “'windows-1252' is not a supported encoding name.”


基础教程推荐
- c# – USING块在网站与Windows窗体中的行为不同 2023-09-20
- C#获取指定目录下某种格式文件集并备份到指定文件夹 2023-05-30
- C#调用摄像头实现拍照功能的示例代码 2023-03-09
- 实例详解C#实现http不同方法的请求 2022-12-26
- C#中 Json 序列化去掉null值的方法 2022-11-18
- Unity 如何获取鼠标停留位置下的物体 2023-04-10
- C#中的Linq to JSON操作详解 2023-06-08
- Unity shader实现高斯模糊效果 2023-01-16
- C#通过标签软件Bartender的ZPL命令打印条码 2023-05-16
- C# 解析XML和反序列化的示例 2023-04-14