对于 .NET 的 Aspose.Cells Plugins 提供一个坚实的工具套件,旨在简化和自动化广泛的扩展表相关任务,从转换和数据处理到锁定工作簿和创建图像,这些插件提供模块化、灵活的解决方案,帮助开发人员简化的 Aspose Excel 工作流。
引入
对于 .NET 的 Aspose.Cells Plugins 提供了一个强大的工具集,旨在简化和自动化各种与 spreadsheet 相关的任务,这些插件允许您执行高效的操作,如将 Excel 文件转换为 PDF 或 JSON,从 Spreadsheets 播放图像,处理文本格式,以及保存文档。
Aspose.Cells 插件的概述
PDF 转换器插件
與The Aspose.Cells PDF 转换器 插件,您可以轻松地将 Excel 传输表转换为高可靠的 PDF. 此附件允许无缝集成到您的应用程序,并支持各种自定义选项。
定制 PDF 输出
您可以使用扩展、打印区域和边界等选项自定义 PDF 输出。
using Aspose.Cells;
using System;
public class CustomizePdfOutputExample
{
public static void Main()
{
// Load an existing workbook
Workbook workbook = new Workbook(@"path/to/workbook.xlsx");
// Set up PDF save options with customization
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
// Set scaling factor (e.g., 0.75 for reducing size)
pdfSaveOptions.Scaling = 0.75;
// Define print area to be converted to PDF
pdfSaveOptions.PageIndex = 0;
pdfSaveOptions.PageCount = 1; // Convert only the first page
// Set margins (left, right, top, bottom) in points
pdfSaveOptions.MarginLeft = 20;
pdfSaveOptions.MarginRight = 20;
pdfSaveOptions.MarginTop = 20;
pdfSaveOptions.MarginBottom = 20;
// Save the workbook as PDF with custom options
workbook.Save(@"path/to/output.pdf", pdfSaveOptions);
Console.WriteLine("PDF conversion completed with custom settings.");
}
}
JSON 转换器插件
是的 Aspose.Cells JSON 转换器 插件允许将 Excel 数据转换为和从结构化 JSON,使其理想的现代 Web APIs 和微服务。
将工作簿转换为 JSON
您可以将整个工作簿、表或单元格转换为 JSON. 以下是如何实现这一点的例子:
// Load the workbook
Workbook workbook = new Workbook(@"path/to/workbook.xlsx");
// Convert the workbook to JSON
string json = workbook.Worksheets[0].Cells.ExportToJson();
图像转换器插件
與The Aspose.Cells 图像转换器, 您可以将 Excel 工作簿或特定序列转换为图像(例如 PNG、JPEG)。
作为图像出口表
您可以出口表、图标、旋转表和等级作为高品质的图像,这里是如何做到这一点的例子:
// Load the workbook
Workbook workbook = new Workbook(@"path/to/workbook.xlsx");
// Get the first worksheet
Worksheet sheet = workbook.Worksheets[0];
// Export the worksheet as a PNG image
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.ImageFormat = NetOffice.ExcelApi.Enums.XlPictureType.xlBitmap;
sheet.PageSetup.Export("output.png", options);
文本转换器插件
是的 Aspose.Cells 文本转换器 允许您将 Excel 数据转换为多种文本格式,反之亦然。
将 Excel 文件转换为 CSV
您可以将 Excel 文件转换为 CSV、TSV、XML 或 SQL 脚本格式。
// Load the workbook
Workbook workbook = new Workbook(@"path/to/workbook.xlsx");
// Save as CSV
workbook.Save("output.csv", SaveFormat.Csv);
标签:Locker Plugin
是的 Aspose.Cells Spreadsheet Locker 提供强大的功能,以保护和安全的Excel文件在不同的水平。
通过代码锁定工作簿
您可以锁定整个工作簿或特定工作表,应用密码保护,并确保文档结构。
// Load the workbook
Workbook workbook = new Workbook(@"path/to/workbook.xlsx");
// Protect the workbook with a password
workbook.Protect(ProtectionType.WorksheetAndWindow, "password123");
结论
Aspose.Cells Plugins for .NET 是为了提高生产力和简化复杂的分布式操作而构建的。 支持论坛 或者咨询 Aspose 细胞文档探索可用的广泛资源,了解如何在您的 .NET 应用程序中有效地使用这些插件。