Bootcamp

From idea to product, one lesson at a time. To submit your story: https://tinyurl.com/bootspub1

Follow publication

How to Create Pdf’s in C#

A guide to the best open-source Pdf library in .Net: QuestPdf.

Andrei Schiller-Chan
Bootcamp
Published in
11 min readOct 24, 2022
Photo by Mohammad Rahmani on Unsplash

Are you tired of converting HTML to Pdf? Are you at your wit's end trying to get your page numbers to change dynamically no matter the length of your table? Are you sick of your reports looking like a degenerate hamster knocked one out in his spare time?

Then look no further… QuestPdf is here to save the day — and the best thing is, it's Open Source.

Sorry AsposePdf. You’re out. Next!

First off, let’s give a big shoutout to the legend, the superstar, this specimen of a man, to the creator of QuestPdf, Marcin Ziąbek. This man has saved us literally thousands of pounds, and development hours, generating reports for our company. Not only that but we clocked it to be at least 50% faster than AsposePdf!

Please join us by buying this man a coffee, donating, or sponsoring his project here: https://github.com/QuestPDF/QuestPDF

What I want you to get from this is that you simply copy and paste the code below, then strip away from it what you don’t need. Basically, I give you an intact bike, and you throw away the tassles, bells, and playing cards in the spokes whilst leaving the frame intact!

How to get started!

First of all, QuestPdf already has fantastic documentation here but if you want to see some cutting-edge stuff, I’ve included an example statement, and the code behind it to really show you its power! This is actually close to some of the statements we send out to customers currently, obviously with a few tweaks here and there…

So, all you need to do is install the library via the nuget package manager specifically for QuestPdf & QuestPdf.Previewer (if in dotnet 6).

Without further ado, this is what we are building:

1. A page with a table, shapes, and images, and…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Bootcamp
Bootcamp

Published in Bootcamp

From idea to product, one lesson at a time. To submit your story: https://tinyurl.com/bootspub1

Andrei Schiller-Chan
Andrei Schiller-Chan

Written by Andrei Schiller-Chan

Software Engineer @moneybox UK | Voice Coach @Orator | Ex-State Boxer 🥊 | Brazilian Jiu-Jitsu 🟣🥋| www.oratorvoice.com

Responses (4)

Write a response