c# - 提取 FDF 注释
问题描述
我的机器中保存了 FDF 文件,我想从 fdf 中提取注释。我在 C# 中使用 Itextsharp。
我找到了PDF阅读器方法。我不知道如何将 FDF 阅读器文件转换为 pdf 阅读器
using (FdfReader fdfReader = new FdfReader(FdfFileLocation))
{
FdfReader fdfReaderas = new FdfReader(FdfFileLocation);
int fr = fdfReader.NumberOfPages;
//annotsReader = new PdfReader(formLocation);
for (int page = 1; page <= fdfReaderas.NumberOfPages; ++page)
{
PdfDictionary pagedic = fdfReaderas.GetPageN(page);
PdfArray annotarray = (PdfArray)PdfReader.GetPdfObject(pagedic.Get(PdfName.ANNOTS));
if (annotarray == null || annotarray.Size == 0)
continue;
int couter = 1;
foreach (PdfObject A in annotarray.ArrayList)
{
couter++;
PdfDictionary AnnotationDictionary = (PdfDictionary)PdfReader.GetPdfObject(A);
PdfString AnnotationTitle = AnnotationDictionary.GetAsString(PdfName.T);
PdfString AnnotationContent = AnnotationDictionary.GetAsString(PdfName.CONTENTS);
}
}
无论如何我们可以从 fdf 文件中找到注释吗
解决方案
推荐阅读
- http - 资产在 localhost 上默认为 HTTPS
- python - GAN 生成器准确率达到 100%
- react-native - 在 Stack Navigator 之间切换 React Native Navigation V5
- python - 如何禁用对熊猫“df.to_csv”中现有值的数据框附加
- node.js - 在 AWS lambda 中调用嵌套函数
- python - 如何在 python 3.8.5 中创建 py 文件的可执行文件?
- mongodb - 模式选项猫鼬中的数据和类型有什么区别
- qt - 来自 qt 的 .ui 文件是否与 python 和 c++ 兼容?
- c# - c#异步文件写入期间的锁定功能
- node.js - 有没有办法可以列出不和谐服务器中的频道