A minimal, zero-dependency .NET library for generating PDF documents from text and Excel files.
$ dotnet add package MiniPdfA minimal, zero-dependency .NET library for converting Excel (.xlsx) files to PDF.
Security: All PRs are automatically reviewed by Copilot AI and Azure AI security scan for vulnerabilities.
.xlsx files to paginated PDF with automatic column layoutdotnet add package MiniPdf
using MiniPdf;
// File to file
MiniPdf.ConvertToPdf("data.xlsx", "data.pdf");
// File to byte array
byte[] pdfBytes = MiniPdf.ConvertToPdf("data.xlsx");
// Stream to byte array
using var stream = File.OpenRead("data.xlsx");
byte[] pdfBytes = MiniPdf.ConvertToPdf(stream);
MiniPdf output is compared against LibreOffice as the reference renderer across 60 classic test cases.
| Category | Count | Threshold |
|---|---|---|
| 🟢 Excellent | 54 | ≥ 90% |
| 🟡 Acceptable | 5 | 70% – 90% |
| 🔴 Needs Improvement | 1 | < 70% |
Average overall score: 96.2% (text similarity 40% + visual similarity 40% + page count 20%)
All 60 test cases comparing MiniPdf output (left) vs LibreOffice reference (right). Page 1 shown for multi-page results.
| Test Case | MiniPdf | LibreOffice (Reference) | Score |
|---|---|---|---|
| Basic table with headers |
![]() |
![]() |
| 🟢 99.8% |
| classic02 Multiple worksheets | ![]() | ![]() | 🟢 99.5% |
| classic03 Empty workbook | ![]() | ![]() | 🟢 100.0% |
| classic04 Single cell | ![]() | ![]() | 🟢 100.0% |
| classic05 Wide table | ![]() | ![]() | 🟢 99.7% |
| classic06 Tall table | ![]() | ![]() | 🟢 95.1% |
| classic07 Numbers only | ![]() | ![]() | 🟢 99.9% |
| classic08 Mixed text and numbers | ![]() | ![]() | 🟢 99.9% |
| classic09 Long text MiniPdf: 1 page Reference: 12 pages | ![]() | ![]() | 🔴 20.3% |
| classic10 Special XML characters | ![]() | ![]() | 🟢 99.8% |
| classic11 Sparse rows | ![]() | ![]() | 🟢 100.0% |
| classic12 Sparse columns | ![]() | ![]() | 🟢 99.9% |
| classic13 Date strings | ![]() | ![]() | 🟢 98.8% |
| classic14 Decimal numbers | ![]() | ![]() | 🟢 99.8% |
| classic15 Negative numbers | ![]() | ![]() | 🟢 99.8% |
| classic16 Percentage strings | ![]() | ![]() | 🟢 99.6% |
| classic17 Currency strings | ![]() | ![]() | 🟢 99.0% |
| classic18 Large dataset | ![]() | ![]() | 🟢 91.5% |
| classic19 Single column list | ![]() | ![]() | 🟢 99.7% |
| classic20 All empty cells | ![]() | ![]() | 🟢 100.0% |
| classic21 Header only | ![]() | ![]() | 🟢 99.9% |
| classic22 Long sheet name | ![]() | ![]() | 🟢 99.9% |
| classic23 Unicode text | ![]() | ![]() | 🟡 86.1% |
| classic24 Red text | ![]() | ![]() | 🟢 99.8% |
| classic25 Multiple colors | ![]() | ![]() | 🟢 99.5% |
| classic26 Inline strings | ![]() | ![]() | 🟢 99.9% |
| classic27 Single row | ![]() | ![]() | 🟢 99.9% |
| classic28 Duplicate values | ![]() | ![]() | 🟢 99.8% |
| classic29 Formula results | ![]() | ![]() | 🟢 99.8% |
| classic30 Mixed empty and filled sheets | ![]() | ![]() | 🟢 99.9% |
| classic31 Bold header row | ![]() | ![]() | 🟢 99.7% |
| classic32 Right-aligned numbers | ![]() | ![]() | 🟢 99.9% |
| classic33 Centered text | ![]() | ![]() | 🟢 99.9% |
| classic34 Explicit column widths | ![]() | ![]() | 🟢 99.8% |
| classic35 Explicit row heights | ![]() | ![]() | 🟢 96.8% |
| classic36 Merged cells | ![]() | ![]() | 🟢 97.8% |
| classic37 Freeze panes | ![]() | ![]() | 🟢 99.1% |
| classic38 Hyperlink cell | ![]() | ![]() | 🟢 99.2% |
| classic39 Financial table | ![]() | ![]() | 🟢 99.6% |
| classic40 Scientific notation | ![]() | ![]() | 🟢 94.6% |
| classic41 Integer vs float | ![]() | ![]() | 🟢 97.6% |
| classic42 Boolean values | ![]() | ![]() | 🟢 92.6% |
| classic43 Inventory report | ![]() | ![]() | 🟢 99.2% |
| classic44 Employee roster | ![]() | ![]() | 🟡 81.6% |
| classic45 Sales by region (4 sheets) | ![]() | ![]() | 🟢 99.9% |
| classic46 Grade book | ![]() | ![]() | 🟢 99.5% |
| classic47 Time series | ![]() | ![]() | 🟢 98.6% |
| classic48 Survey results | ![]() | ![]() | 🟢 98.8% |
| classic49 Contact list | ![]() | ![]() | 🟡 86.4% |
| classic50 Budget vs actuals (3 sheets) | ![]() | ![]() | 🟢 99.1% |
| classic51 Product catalog | ![]() | ![]() | 🟡 77.2% |
| classic52 Pivot summary | ![]() | ![]() | 🟢 99.3% |
| classic53 Invoice layout | ![]() | ![]() | 🟢 96.0% |
| classic54 Multi-level header | ![]() | ![]() | 🟢 99.5% |
| classic55 Error values (#N/A, #DIV/0!) | ![]() | ![]() | 🟢 99.7% |
| classic56 Alternating row colors | ![]() | ![]() | 🟢 98.9% |
| classic57 CJK-only sheet | ![]() | ![]() | 🟡 84.0% |
| classic58 Mixed numeric formats | ![]() | ![]() | 🟢 94.8% |
| classic59 Multi-sheet summary (4 sheets) | ![]() | ![]() | 🟢 99.8% |
| classic60 Large wide table (20×50) | ![]() | ![]() | 🟢 94.9% |
MIT