TJC.Cyclops.PdfKit 2026.7.9.4

dotnet add package TJC.Cyclops.PdfKit --version 2026.7.9.4
                    
NuGet\Install-Package TJC.Cyclops.PdfKit -Version 2026.7.9.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TJC.Cyclops.PdfKit" Version="2026.7.9.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TJC.Cyclops.PdfKit" Version="2026.7.9.4" />
                    
Directory.Packages.props
<PackageReference Include="TJC.Cyclops.PdfKit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TJC.Cyclops.PdfKit --version 2026.7.9.4
                    
#r "nuget: TJC.Cyclops.PdfKit, 2026.7.9.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TJC.Cyclops.PdfKit@2026.7.9.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TJC.Cyclops.PdfKit&version=2026.7.9.4
                    
Install as a Cake Addin
#tool nuget:?package=TJC.Cyclops.PdfKit&version=2026.7.9.4
                    
Install as a Cake Tool

📄 Cyclops.PdfKit

📝 项目概述

Cyclops.PdfKit 是企服版框架中的PDF处理专家,为您的应用程序提供高效、灵活的PDF文档操作功能! 🚀

我们精心设计的工具包专注于PDF文本提取、内容分析和基本操作,为企业应用中的PDF处理需求提供了简洁而强大的解决方案。无论是需要提取PDF中的文本,还是分析文档结构,Cyclops.PdfKit都能为您提供出色的支持。

✨ 为什么选择 Cyclops.PdfKit?

  • 高效处理:快速提取PDF文本和内容
  • 灵活分析:支持PDF文档结构和内容分析
  • 易于使用:简洁的API接口,上手即用
  • 轻量集成:无需复杂配置,直接引用即可使用
  • 强大功能:支持文本提取、内容搜索、文档信息获取等多种功能

🎯 核心功能模块

🛠️ PDF工具类(PdfUtil)

  • 基本操作:提供PDF文档的基本操作接口
  • 文本提取:支持PDF文本提取和内容分析
  • 页面管理:提供PDF页面管理功能
  • 内容搜索:支持PDF内容搜索和定位
  • 文档信息:提供PDF文档信息获取

📝 文本块处理(TextChunk)

  • 数据结构:定义PDF文本块数据结构
  • 属性管理:提供文本块位置、大小、内容等属性
  • 比较分析:支持文本块的比较和分析
  • 结构化处理:用于PDF文本提取和结构化处理

📊 PDF内容分析

  • 结构分析:提供PDF文档结构分析
  • 元素识别:支持文本、图像等元素的识别和提取
  • 格式分析:提供基本的PDF格式分析

🔄 PDF文档操作

  • 页面操作:提供PDF页面的基本操作
  • 编辑功能:支持简单的PDF编辑功能
  • 内容访问:提供PDF内容的读取和访问

🛠️ 技术栈

  • .NET 8.0:基础开发框架,利用最新的.NET特性
  • PDF处理库:用于底层PDF文档解析,提供高效的PDF处理能力
  • Cyclops.Common:框架核心公共组件

📦 环境依赖

  • .NET 8.0 或更高版本
  • 相关PDF处理库:自动通过NuGet安装
  • 支持的平台:Windows、Linux、macOS
  • IDE推荐:Visual Studio 2022、Visual Studio Code

🚀 安装配置

🔍 安装方式

NuGet包管理器
Install-Package TJC.Cyclops.PdfKit
.NET CLI
dotnet add package TJC.Cyclops.PdfKit
PackageReference
<PackageReference Include="TJC.Cyclops.PdfKit" Version="1.0.0" />

⚙️ 配置

无需额外配置,直接引用即可使用!Cyclops.PdfKit设计为轻量级组件,开箱即用,无需复杂的配置步骤。

🎯 使用建议

  • 文件路径:确保提供正确的PDF文件路径
  • 异常处理:实现适当的异常处理,处理PDF文件不存在或格式错误的情况
  • 内存管理:处理大型PDF文件时,注意内存使用情况
  • 性能优化:对于批量处理,考虑使用异步操作提高性能

📝 使用示例

📄 PDF文本提取

以下示例展示了如何使用 Cyclops.PdfKit 提取PDF文档中的文本:

// 提取PDF文档中的所有文本
string pdfPath = "example.pdf";
string text = PdfUtil.ExtractText(pdfPath);
Console.WriteLine(text);

// 提取指定页面的文本
string pageText = PdfUtil.ExtractTextFromPage(pdfPath, 1); // 提取第1页文本

📝 PDF文本块分析

以下示例展示了如何使用 Cyclops.PdfKit 分析PDF文档中的文本块:

// 获取PDF文档中的文本块
List<TextChunk> chunks = PdfUtil.GetTextChunks("example.pdf");

// 遍历文本块
foreach (var chunk in chunks)
{
    Console.WriteLine($"文本: {chunk.Text}");
    Console.WriteLine($"位置: X={chunk.X}, Y={chunk.Y}");
    Console.WriteLine($"大小: Width={chunk.Width}, Height={chunk.Height}");
}

📊 PDF文档信息获取

以下示例展示了如何使用 Cyclops.PdfKit 获取PDF文档的基本信息:

// 获取PDF文档信息
var info = PdfUtil.GetDocumentInfo("example.pdf");
Console.WriteLine($"标题: {info.Title}");
Console.WriteLine($"作者: {info.Author}");
Console.WriteLine($"页数: {info.PageCount}");
Console.WriteLine($"创建日期: {info.CreationDate}");

4. PDF内容搜索

// 在PDF中搜索文本
List<SearchResult> results = PdfUtil.SearchText("example.pdf", "关键词");

// 输出搜索结果
foreach (var result in results)
{
    Console.WriteLine($"页码: {result.PageNumber}");
    Console.WriteLine($"位置: X={result.X}, Y={result.Y}");
    Console.WriteLine($"上下文: {result.Context}");
}

5. 文本块操作

// 创建文本块
var chunk = new TextChunk
{
    Text = "示例文本",
    X = 100,
    Y = 200,
    Width = 150,
    Height = 20
};

// 文本块比较
var anotherChunk = new TextChunk { Text = "示例文本" };
bool isEqual = chunk.Equals(anotherChunk);

// 获取文本块的边界信息
var rectangle = chunk.GetBounds();

🤝 贡献者

我们欢迎社区贡献!如果您有任何改进建议或功能需求,欢迎提交PR或Issue。

  • yswenli:核心开发者

📋 版本信息

  • 当前版本NuGet version (Cyclops.Framework)
  • 作者:yswenli
  • 描述:企服版框架中PDF处理工具包
  • 更新频率:定期更新,持续改进

📄 许可证

保留所有权利

🎉 结语

Cyclops.PdfKit 致力于为您的应用程序提供高效、灵活的PDF处理能力。我们相信,通过简化PDF处理的复杂性,您可以更专注于业务逻辑的实现,构建出更强大、更实用的PDF相关应用。

如果您有任何问题或建议,欢迎与我们联系!让我们一起构建更好的PDF处理解决方案! 🚀

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.7.9.4 105 7/9/2026
2026.7.9.3 94 7/9/2026
2026.7.9.2 94 7/9/2026
2026.7.9.1 103 7/9/2026
2026.7.8.2 81 7/8/2026
2026.7.8.1 103 7/8/2026
2026.7.6.1 96 7/6/2026
2026.7.1.1 111 7/1/2026
2026.6.24.1 97 6/24/2026
2026.6.23.1 110 6/23/2026
2026.6.22.2 101 6/22/2026
2026.6.22.1 109 6/22/2026
2026.6.11.2 113 6/11/2026
2026.6.11.1 108 6/11/2026
2026.6.9.4 105 6/9/2026
2026.6.9.3 112 6/9/2026
2026.6.9.2 107 6/9/2026
2026.6.9.1 111 6/9/2026
2026.6.8.3 111 6/8/2026
2026.6.8.2 108 6/8/2026
Loading failed

基于iText7的pdf文本替换工具集