Skip to content

mini-software/MiniPdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniPdf


A minimal, zero-dependency .NET library for converting office files to PDF.

Features

  • Excel-to-PDF — Convert .xlsx files to paginated PDF with automatic column layout
  • Embedded images — JPEG and PNG images embedded in Excel sheets are rendered in the PDF output
  • Zero dependencies — Uses only built-in .NET APIs (no external packages)
  • Valid PDF 1.4 output
  • Word-to-PDF — In development
  • Chart — Not currently supported well

Getting Started

Install via NuGet

dotnet add package MiniPdf

Usage

using MiniSoftware;

// 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);

Benchmark

MiniPdf output is compared against LibreOffice as the reference renderer across 120 classic test cases (including 30 image-embedding cases and 30 chart cases).

Category Count Threshold
🟢 Excellent 97 ≥ 90%
🟡 Acceptable 21 70% – 90%
🔴 Needs Improvement 2 < 70%

Average overall score: 94.7% (text similarity 40% + visual similarity 40% + page count 20%)

Visual Comparison

All test cases comparing MiniPdf output vs LibreOffice reference. Page 1 shown for multi-page results.

MiniPdfLibreOffice (Reference)
classic01 Basic table with headers 🟢 99.7%
classic02 Multiple worksheets 🟢 99.7%
classic03 Empty workbook 🟢 100.0%
classic04 Single cell 🟢 100.0%
classic05 Wide table 🟢 99.5%
classic06 Tall table 🟢 97.2%
classic07 Numbers only 🟢 99.9%
classic08 Mixed text and numbers 🟢 99.8%
classic09 Long text 🔴 50.5%
classic10 Special xml characters 🟢 99.8%
classic11 Sparse rows 🟢 100.0%
classic12 Sparse columns 🟢 99.9%
classic13 Date strings 🟢 97.6%
classic14 Decimal numbers 🟢 99.8%
classic15 Negative numbers 🟢 99.8%
classic16 Percentage strings 🟢 99.7%
classic17 Currency strings 🟢 98.3%
classic18 Large dataset 🟢 94.7%
classic19 Single column list 🟢 99.8%
classic20 All empty cells 🟢 100.0%
classic21 Header only 🟢 100.0%
classic22 Long sheet name 🟢 99.9%
classic23 Unicode text 🟢 91.8%
classic24 Red text 🟢 99.7%
classic25 Multiple colors 🟢 99.5%
classic26 Inline strings 🟢 99.9%
classic27 Single row 🟢 99.9%
classic28 Duplicate values 🟢 99.7%
classic29 Formula results 🟢 99.7%
classic30 Mixed empty and filled sheets 🟢 99.9%
classic31 Bold header row 🟢 99.4%
classic32 Right aligned numbers 🟢 99.8%
classic33 Centered text 🟢 99.9%
classic34 Explicit column widths 🟢 99.7%
classic35 Explicit row heights 🟢 98.4%
classic36 Merged cells 🟢 98.2%
classic37 Freeze panes 🟢 99.3%
classic38 Hyperlink cell 🟢 99.8%
classic39 Financial table 🟢 99.5%
classic40 Scientific notation 🟢 95.5%
classic41 Integer vs float 🟢 97.5%
classic42 Boolean values 🟢 99.4%
classic43 Inventory report 🟢 99.0%
classic44 Employee roster 🟢 97.4%
classic45 Sales by region 🟢 99.8%
classic46 Grade book 🟢 99.4%
classic47 Time series 🟢 98.9%
classic48 Survey results 🟢 98.7%
classic49 Contact list 🟢 95.0%
classic50 Budget vs actuals 🟢 99.1%
classic51 Product catalog 🟢 98.1%
classic52 Pivot summary 🟢 99.0%
classic53 Invoice 🟢 99.3%
classic54 Multi level header 🟢 99.2%
classic55 Error values 🟢 99.5%
classic56 Alternating row colors 🟡 88.6%
classic57 Cjk only 🟡 85.2%
classic58 Mixed numeric formats 🟢 95.7%
classic59 Multi sheet summary 🟢 99.7%
classic60 Large wide table 🟢 96.4%
classic61 Product card with image 🟢 98.5%
classic62 Company logo header 🟢 98.7%
classic63 Two products side by side 🟢 98.3%
classic64 Employee directory with photo 🟢 98.1%
classic65 Inventory with product photos 🟢 97.3%
classic66 Invoice with logo 🟢 98.4%
classic67 Real estate listing 🟢 98.0%
classic68 Restaurant menu 🟢 96.6%
classic69 Image only sheet 🟢 97.3%
classic70 Product catalog with images 🟢 96.8%
classic71 Multi sheet with images 🟢 99.1%
classic72 Bar chart image with data 🟢 97.4%
classic73 Event flyer with banner 🟢 96.6%
classic74 Dashboard with kpi image 🟢 95.6%
classic75 Certificate with seal 🟢 98.7%
classic76 Product image grid 🟢 97.9%
classic77 News article with hero image 🟢 96.7%
classic78 Small icon per row 🟢 98.7%
classic79 Wide panoramic banner 🟢 96.4%
classic80 Portrait tall image 🟢 98.6%
classic81 Step by step with images 🟢 97.7%
classic82 Before after images 🟢 96.2%
classic83 Color swatch palette 🟢 97.9%
classic84 Travel destination cards 🟢 96.5%
classic85 Lab results with image 🟢 91.5%
classic86 Software screenshot features 🟢 97.8%
classic87 Sports results with logos 🟢 99.3%
classic88 Image after data 🟢 98.7%
classic89 Nutrition label with image 🟢 98.3%
classic90 Project status with milestones 🟢 94.1%
classic91 Simple bar chart 🟢 96.7%
classic92 Horizontal bar chart 🟡 83.1%
classic93 Line chart 🟢 92.9%
classic94 Pie chart 🟡 89.2%
classic95 Area chart 🟡 73.3%
classic96 Scatter chart 🟡 87.0%
classic97 Doughnut chart 🟢 91.3%
classic98 Radar chart 🟡 89.7%
classic99 Bubble chart 🟡 83.6%
classic100 Stacked bar chart 🟢 91.3%
classic101 Percent stacked bar 🟡 87.1%
classic102 Line chart with markers 🟢 91.4%
classic103 Pie chart with labels 🟡 82.3%
classic104 Combo bar line chart 🟡 81.5%
classic105 3d bar chart 🟡 84.2%
classic106 3d pie chart 🟢 91.3%
classic107 Multi series line 🟡 80.0%
classic108 Stacked area chart 🟡 89.8%
classic109 Scatter with trendline 🟡 82.2%
classic110 Chart with legend 🟡 82.9%
classic111 Chart with axis labels 🟡 83.2%
classic112 Multiple charts 🟡 84.7%
classic113 Chart sheet 🟡 81.8%
classic114 Chart large dataset 🟢 91.0%
classic115 Chart negative values 🟢 93.8%
classic116 Percent stacked area 🟡 86.0%
classic117 Stock ohlc chart 🟡 80.0%
classic118 Bar chart custom colors 🟢 94.6%
classic119 Dashboard multi charts 🟢 92.2%
classic120 Chart with date axis 🔴 64.1%

License

This project is licensed under the Apache License 2.0.

About

[Beta status] A minimal, zero-dependency .NET library for generating PDF documents from text and Excel (.xlsx) files.

Topics

Resources

License

Stars

Watchers

Forks

Contributors