Better HN
topnewbestaskshowjobs
Log inSign up

MarcinZiabek

6 karma · joined Mar 14, 2022 (4y ago) · 13 submissions

Technology enthusiast loving software development since the age of 10. Now interested in the hardest programming challenges, development optimization, machine learning and open-source movement.

Trying to expand his knowledge in various programming-related areas, understand and properly apply patterns and practices, see the bigger picture and create new technologies which not only improve the software itself but also make users experience better.

https://marcin.ziabek.com/

Submissions

comment 3y ago · link · parent

What if the code resembles the markup language in terms of readability, but still gives you access to more advanced features? Surely, there is space for various approaches, it all depends on your task and requirements

comment 3y ago · link · parent

I am not sure if it is a good idea to think about webpage and PDF content as the same. After all, they both serve different purpose and their layout shouldd be optimized for the use case.

comment 3y ago · link · parent

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.

comment 3y ago · link · parent

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?

comment 4y ago · link · parent

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 :)

6.

Show HN: C# library for PDF generation got redesigned documentation (QuestPDF)(github.com ↗)

3 points · by MarcinZiabek · 4y ago · 2 comments

comment 4y ago · link · parent

QuestPDF can produce both PDF files and set of images. Of course, this requires using the library to implement reports, but it is an option to consider :)

comment 4y ago · link · parent

If you think that QuestPDF can improve your workflow and help in projects development, please consider giving it a star. It takes seconds and help thousands of developers!

Official project repository: https://github.com/QuestPDF/QuestPDF

9.

QuestPDF: C# Library for PDF Generation, Presented on JetBrains OSS Power-Ups(youtube.com ↗)

4 points · by MarcinZiabek · 4y ago · 3 comments

10.

QuestPDF (open-source C# library for PDF generation) gets hot-reload previewer(github.com ↗)

1 points · by MarcinZiabek · 4y ago · discuss

comment 4y ago · link · parent

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!

12.

Show HN: Open-source library solving PDF generation nightmares in .NET C#(github.com ↗)

2 points · by MarcinZiabek · 4y ago · 1 comment