ExcelToPdfConvertor 1.0.1
dotnet add package ExcelToPdfConvertor --version 1.0.1
NuGet\Install-Package ExcelToPdfConvertor -Version 1.0.1
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="ExcelToPdfConvertor" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ExcelToPdfConvertor" Version="1.0.1" />
<PackageReference Include="ExcelToPdfConvertor" />
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 ExcelToPdfConvertor --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ExcelToPdfConvertor, 1.0.1"
#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 ExcelToPdfConvertor@1.0.1
#: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=ExcelToPdfConvertor&version=1.0.1
#tool nuget:?package=ExcelToPdfConvertor&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
📂 Excel to Pdf Converter
A reusable .NET class library to convert Excel to Pdf.
✨Features
- ✅ Convert Excel workbooks into PDF format.
- ✅ Exports rows as structured objects (with { ... } format).
- ✅ Handles page overflow by continuing data on new pages.
- ✅ Lightweight and easy to integrate into any .NET project.
🚀 Installation
Install the NuGet package:
dotnet add package ExcelToPdfConvertor --version 1.0.1
Usage Example
using ExcelToPdfConvertor;
_excelToPdfService.ConvertExcelToPdf(excelFilePath, pdfFilePath);
Usage Example (ASP.NET Core API)
public async Task<IActionResult> ConvertExcelToPdf(IFormFile file)
{
if (file == null || file.Length == 0)
return BadRequest("Please upload a valid Excel file.");
// Create a temp path for uploaded Excel file
var uploadsFolder = Path.Combine(Path.GetTempPath(), "ExcelUploads");
Directory.CreateDirectory(uploadsFolder);
var excelFilePath = Path.Combine(uploadsFolder, file.FileName);
// Save the uploaded file
using (var stream = new FileStream(excelFilePath, FileMode.Create))
{
await file.CopyToAsync(stream);
}
// Output path for PDF
var pdfFilePath = Path.Combine(uploadsFolder, Path.GetFileNameWithoutExtension(file.FileName) + ".pdf");
// Use your custom NuGet package here
_excelToPdfService.ConvertExcelToPdf(excelFilePath, pdfFilePath);
// Read the PDF file back to return to client
var pdfBytes = await System.IO.File.ReadAllBytesAsync(pdfFilePath);
// Return as downloadable file
return File(pdfBytes, "application/pdf", Path.GetFileName(pdfFilePath));
}
Notes
- Currently supports .xlsx Excel format (via ClosedXML).
- Exports rows as structured objects (with { ... } format).
- Can be integrated into ASP.NET Core APIs, or console applications.
License
MIT License
| Product | Versions 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.
-
net8.0
- ClosedXML (>= 0.105.0)
- PdfSharpCore (>= 1.3.67)
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 |
|---|---|---|
| 1.0.1 | 281 | 8/20/2025 |