-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Wei Lin edited this page Mar 2, 2026
·
5 revisions
A minimal, zero-dependency .NET library for converting Excel (.xlsx) files to PDF.
| Page | Description |
|---|---|
| Benchmark | Self-evolution benchmark pipeline (60 test cases, 96.2% avg score) |
| PDF Coding Standards | Coding conventions and standards for the MiniPdf library |
| AI CI Reviewer Setup | Copilot code review and Azure AI security scan |
| NuGet Package | NuGet publishing workflow and configuration |
MiniPdf converts Excel .xlsx files to paginated PDF without any external dependencies — only built-in .NET APIs.
- Excel-to-PDF — Automatic column layout, multi-page, text wrapping, font colors
-
Zero dependencies — No external NuGet packages; uses
System.IO.Compression+System.Xml - Valid PDF 1.4 output compatible with all PDF readers
-
Streaming API — Works with files, paths, or
Streaminputs
MiniPdf.sln
├── src/MiniPdf/ # Library (zero-dependency)
│ ├── MiniPdf.cs # Public API entry point
│ ├── ExcelToPdfConverter.cs # Core converter (column grouping, wrapping)
│ ├── ExcelReader.cs # .xlsx parser (sparse rows, shared strings)
│ ├── PdfDocument.cs # PDF document model
│ ├── PdfPage.cs # Page with text placement
│ ├── PdfWriter.cs # Low-level PDF 1.4 binary writer
│ ├── PdfTextBlock.cs # Text block data
│ └── PdfColor.cs # RGB color support
└── tests/
├── MiniPdf.Tests/ # xUnit unit tests (93 tests)
│ ├── ClassicExcelToPdfTests.cs # 60 classic scenario tests
│ └── ExcelToPdfConverterTests.cs # Converter unit tests
├── MiniPdf.Benchmark/ # Self-evolution benchmark pipeline
│ ├── run_benchmark.py # Total pipeline controller
│ ├── compare_pdfs.py # MiniPdf vs LibreOffice comparison engine
│ ├── generate_reference_pdfs.py # LibreOffice reference PDF generator
│ └── reports/ # HTML / JSON / Markdown reports
└── MiniPdf.Scripts/ # Excel generators and converters
├── generate_classic_xlsx.py # 60 classic .xlsx test file generator
└── convert_xlsx_to_pdf.cs # dotnet-script converter runner
dotnet add package MiniPdfusing MiniSoftware;
// File → File
MiniPdf.ConvertToPdf("report.xlsx", "report.pdf");
// File → byte[]
byte[] pdf = MiniPdf.ConvertToPdf("report.xlsx");
// Stream → byte[]
using var stream = File.OpenRead("report.xlsx");
byte[] pdf = MiniPdf.ConvertToPdf(stream);| Metric | Value |
|---|---|
| Test cases | 60 |
| Average score | 96.2% |
| 🟢 Excellent (≥ 90%) | 54 |
| 🟡 Acceptable (70–90%) | 5 |
| 🔴 Needs improvement (< 70%) | 1 (classic09 long-text multi-page) |
| C# unit tests passing | 93 / 93 |
See Benchmark for the full pipeline and score table.
Every PR to main runs:
-
dotnet build+dotnet test(93 tests) - Copilot Code Review — automatic PR review comments
-
Azure AI Security Scan — GPT-4.1 scans
.csdiff, fails CI on security issues
See AI CI Reviewer Setup for details.