MarcinZiabek's comments

MarcinZiabek | 3 years ago | on: QuestPDF: Modern .NET library for PDF document generation

The concept of writing the presentation layer in the actual programming language isn't new. Flutter developed by Google is a great example.

It all depends on how you structure your code. Of course, you can create huge chunks of HTML+CSS that cover your entire document. Or, to improve maintainability, you can split that HTML into multiple components and compose them together.

Very similar rules can be applied to this library, where you split your code into smaller parts by using properly named methods. That gives you better understandding on the structure and ways to traverse the implementation.

Futhermore, using a programming language gives you many benefits. You can rely on all language features like loops, conditions, methods, formatting, recursion, etc. You have access to IntelliSense, static analysis and refectoring tools.

In terms of changing the layout content - it would be equally difficult when using any markup language. After all, you don't want to parse markup file every time you generate PDF - for performance reasons.

HTML may be a good choice for relatively simple documents, where you don't care that much about splitting content between pages, etc. However, you still will fight with performance problems related to running entire web browser.

MarcinZiabek | 3 years ago | on: QuestPDF: Modern .NET library for PDF document generation

There are many good reasons of choosing the programming language over a markup language. C# has countless of features, both functional and syntactic: conditions, loops, methods, formatting, iteration, recursion, etc. Additionally, each of those features is well supported by all major IDEs. Writing your presentation layer in a proper programming language does not only rely on your existing skills but also gives you access to tools such us code completion and IntelliSense. Moreover, using FluentAPI helps with keeping the code concise and easy to change.

At the end of the day, it all depends on how you use the technology, doesn't it?

MarcinZiabek | 3 years ago | on: Show HN: C# library for PDF generation got redesigned documentation (QuestPDF)

Generating PDF from HTML works in many simple cases. Once you want to have finer control over the content, document structure becomes more and more complex, and you want to achieve higher performance - having a proper tool is really important. It all depends on the scale of your solution, how often you perform changes, and how fast should be the development loop before it is too painful.

I got a lot of positive feedback from QuestPDF users, and I hope that it will become useful for more developers in the .NET ecosystem :)

MarcinZiabek | 4 years ago | on: Show HN: Open-source library solving PDF generation nightmares in .NET C#

QuestPDF is an open-source .NET library for PDF documents generation.

It offers a layouting engine designed with a full paging support in mind. The document consists of many simple elements (e.g. border, background, image, text, padding, table, grid etc.) that are composed together to create more complex structures. This way, as a developer, you can understand the behavior of every element and use them with full confidence. Additionally, the document and all its elements support paging functionality. For example, an element can be moved to the next page (if there is not enough space) or even be split between pages like table's rows.

Unlike other libraries, it does not rely on the HTML-to-PDF conversion which in many cases is not reliable. Instead, it implements its own layouting engine that is optimized to cover all paging-related requirements.

Please consider giving the official repository a star. It takes seconds and help thousands of developers!

page 1