Skip to content

v0.17.0 MiniPdf CLI Tool

Choose a tag to compare

@shps951023 shps951023 released this 18 Mar 11:31
· 150 commits to main since this release

v0.17.0

πŸš€ New: MiniPdf CLI Tool

A brand-new command-line tool (MiniPdf.Cli) for converting Excel (.xlsx) and Word (.docx) files to PDF β€” installable as a .NET global tool via NuGet.

dotnet tool install -g MiniPdf.Cli
minipdf convert input.xlsx -o output.pdf
minipdf convert report.docx --fonts /path/to/fonts
  • Supports --output, --fonts options and shorthand syntax
  • Packaged as a NuGet dotnet tool (PackAsTool)
  • Automated NuGet publish via new GitHub Actions workflow (nuget-publish-cli.yml, triggered by cli-v* tags)

πŸ“ DOCX-to-PDF Improvements

  • CJK font resolution: Per-run font name resolution with East Asia theme font support β€” reads theme1.xml major/minor script fonts, resolves w:rFonts with East Asia language awareness
  • Preferred CJK font propagation: Document's DefaultEastAsiaFontName is now passed to the PDF writer for correct font selection and prioritization
  • Floating text boxes: Added support for wrapNone floating text boxes with absolute page positioning (new DocxFloatingTextBox record)
  • Field instruction parsing: New GetFieldInstructionType for PAGE/NUMPAGES field support in headers/footers
  • List numbering: Added FormatChineseCounting for Chinese-style ordered list numbering; improved list label font alignment (shares same embedded font slot as body text)
  • Character spacing: Per-run CharSpacing tracking and word-spacing propagation during line rendering
  • Line spacing: Correct handling of exact/atLeast spacing (not snapped to document grid per OOXML spec); auto-spacing uses max run font size for grid-snapped height

πŸ–¨οΈ PDF Writer Enhancements

  • Font name normalization & alias matching: NormalizeFontName and IsFontAliasMatch for flexible font resolution
  • CJK font file mapping: New CjkFontFileMap dictionary for well-known CJK font-to-file mapping (Chinese, Japanese, Korean)
  • Font prioritization: PrioritizePreferredCjkFont reorders candidate font paths based on document preference
  • Multi-font slot support: FindPreferredFontIndex and fontNameToSlot dictionary for per-run font slot selection in content streams

πŸ“Š Excel-to-PDF

  • Improved print-scale precision: stores precise float scale to avoid integer rounding loss

🌐 MiniPdf.Web

  • Custom font upload: Users can upload their own .ttf / .otf font files for better CJK rendering
  • Font loading status indicators: Download progress, success, and failure states
  • i18n support: Added I18n.cs with English, Simplified Chinese, and Traditional Chinese translations
  • Enhanced CSS styling for the converter page

πŸ“„ Documentation & Licensing

  • Added open-source and licensing information (Apache 2.0) to all README files (EN, zh-CN, zh-TW, ja, ko, fr, it)
  • New README.nuget.cli.md for CLI NuGet package
  • Updated README to reflect lightweight design and serverless capabilities

πŸ§ͺ Testing & Benchmarks

  • New DOCX-to-PDF unit test: Convert_FooterPageFieldWithSwitch_RendersPageNumber
  • Added test files: Academic Achievement Summary Table (xlsx), SA8000 ch sample, nthu_article (docx)
  • Updated DOCX and XLSX benchmark comparison reports with new test cases
  • Cleaned up outdated benchmark report files and removed obsolete test PDFs (wedding timeline planner, payroll calculator, etc.)

πŸ”§ Other

  • Code refactoring for improved readability and maintainability
  • Updated .gitignore with new patterns
  • Solution file updated to include MiniPdf.Cli project

Full Changelog: v0.16.0...v0.17.0