r/csharp • • 19h ago

Discussion The KillerPDF engine is now MPL 2.0 instead of GPL. Is that better for you?

52 Upvotes

Recently I posted the PDF engine I built in pure C# for KillerPDF, and the main pushback was the license. GPL meant you couldn't put it in your own app unless that app was GPL too, which ruled out most real projects. You were right, I was wrong.

Since 1.9.5 the engine is licensed under the Mozilla Public License 2.0. The KillerPDF desktop app stays GPLv3, but the engine package is separate.

MPL 2.0 works file by file. You can use the engine in your own app, open or closed source, under any license you like. If you change one of the engine's own files and ship it, that file's source has to stay open under MPL 2.0. Your code around it stays yours. I'm trying to encourage better developers than myself to help me make the engine better for everybody.

As part of this, I had to swap out the JPEG 2000 decoder, and the engine now uses OpenJPEG instead of CoreJ2K. That turned out to be a blessing in disguise, because OpenJPEG appears to be more color accurate on the files I've thrown at it. The native decoder ships in the NuGet package for Windows x64, Linux x64 and macOS.

Here's how it compares to PDFsharp/PDFium:

  • Rendering. PDFsharp doesn’t render existing PDF pages. Its FAQ points to a Ghostscript sample for generating page images. PDFium renders through a native library. KillerPdf.Engine renders pages in managed C# without PDFium.
  • Licensing. Starting with 6.5.0, PDFsharp requires applications to initialize either the AGPL license or a paid commercial license. KillerPdf.Engine is MPL 2.0 and can be used in closed-source apps without a license fee, subject to the MPL’s notice and source-sharing requirements.
  • Text. PDFsharp exposes characters in drawing order through low-level APIs, with no built-in word or paragraph grouping. PDFium can extract text and character bounds. KillerPDF previously used PdfPig for extraction. KillerPdf.Engine returns words, lines, and letters with their page coordinates.
  • Editing. PDFsharp offers low-level content-stream editing, and PDFium can replace text in individual text objects. KillerPdf.Engine provides APIs for editing lines and paragraphs on existing PDF pages.
  • Stability. PDFium requires callers to serialize its API calls. KillerPDF 1.6.3 hit a native heap corruption crash when two threads entered PDFium at once. KillerPdf.Engine uses a managed C# page renderer.
  • Signatures. PDFsharp documents how to sign and timestamp PDFs. KillerPdf.Engine also verifies existing signatures and supports certificate trust, timestamp, and revocation checks.
  • Redaction and OCR. PDFsharp’s docs don’t list built-in permanent redaction or OCR. KillerPdf.Engine removes targeted content and reopens the output to check for remnants. The engine can run OCR without Tesseract. The KillerPDF desktop app keeps Tesseract as a fallback.
  • Standards. PDFsharp can write PDF 2.0 and offers limited PDF/A support. KillerPdf.Engine writes PDF 2.0 and provides dedicated authoring modes for PDF/A-4, PDF/A-4e, PDF/A-4f, and PDF/UA-2.

It's on NuGet as KillerPdf.Engine. Docs are at https://killerpdf.net/engine.html and the source is at https://github.com/SteveTheKiller/KillerPDF/tree/main/engine .

So, does MPL actually fix it for you, or is there still something that keeps you from using it? If you'd need something like MIT or Apache to ship it, I'd like to hear why. I'm not fully against moving in that direction.


r/csharp • • 22h ago

Showcase AnyCLI - an AoT-friendly library for building modern CLI apps in C#/.NET

Thumbnail
drmathias.github.io
32 Upvotes

Hi, I've been working on a side project building a CLI application in C# for a few months and during that time tried out various libraries for building CLIs. None of them really fit my needs. I tried contributing to improve them, but in the end decided a whole new approach was needed.

Thus I've created AnyCLI. The philosophy is to optimise for utility and extensibility, while maintaining high-performance and provide sane defaults. Key features include:

  • AOT-compatible command registration and execution
  • Source-generated parameter binding with no runtime reflection
  • Typed positional arguments and named options
  • Required, optional, variadic, collection, and defaulted parameters
  • Nested command groups
  • Custom value parsers
  • Dependency injection support
  • Typed enum exit codes
  • Typed global options
  • Interceptor middleware
  • Cancellation support for async commands and interceptors
  • Fully customisable help and error handling
  • Built in internationalisation - localized error messages and help for English, French, German, Spanish, Brazilian Portuguese, Italian, and Dutch
  • Configurable localization
  • Optional Spectre.Console adapter for rich, styled terminal output and error messages (tables, markup, progress bars etc.)
Feature showcase - localization and rich-rendering with Spectre.Console integration

Benchmarks are solid, beating System.CommandLine and Spectre.Console.Cli in both performance and cold-start time. Though nothing can top performance of ConsoleAppFramework - a testament to the great abilities of the maintainers.

AnyCLI Benchmarks

I'd love for you to try it out and share your feedback. The docs are still a WIP and a stable v1.0.0 is close.


r/csharp • • 2h ago

Help Hi! Minor homework help? Using if-then w/ checkboxes & labels

1 Upvotes

The issue I'm having is mostly getting the label to update. I'm assuming it's just due to my own stupidity that I don't see the problem, but a lot of the code is based on the book i'm issued so that's why i'm a bit stuck.

I think I did most parts of the assignment, however I'm having trouble figuring out labels still lol. I'm not asking for the answer but it'd be nice to know wtf is wrong with it

I've tried reformatting the if-then a bit (hence in this example i've showed it might not look exactly right, i've tried literally everything i could). i've never used nested if-then before, and I'm not getting any error messages so it's hard for me to pinpoint the issue. i've also tried playing around with the lbl name and the positioning

i'm a total newb so some pointers would be appreciated.

the goal is to calculate a total price based on:

product quantity (textbox); product (combo box); & membership status (checkbox), then to have the final output in a label box


r/csharp • • 13h ago

Help Alguien me puede recomendar cursos de YouTube para aprender asp.net ?

0 Upvotes

He buscado en Youtube y los que me salen son desactualizados,de hace 7 o 8 años,o menos,pero como .net suele actualizar rápido las tecnologías que usa,como es el caso de la cantidad de frameworks para GUI que tiene,no sé si me sirvan esos cursos,lo otro es que los que he visto son de mvc,o sea para renderizar web,y lo que busco en rest con manejo de token ,oauth ect,vengo de java,estoy aprendiendo c# ahora pero estoy buscando los cursos de asp con antelación para poder verlos una vez entienda las bases de c#,pienso aprender asp.net luego de saber las bases del lenguaje,ado.net y entity framework core