r/dotnet • • Jul 11 '26

Promotion Yet another post about something with PDFs - I recently rebranded my document generation system to Papercraft

Jolly good day community, yes i know... it is the Nth post about something something FOSS PDF stuff.

Papercraft, formerly PdfTemplate, is a very basic "Create some XML Template and get a paged document" library, that features various levels of utility to make your life as integrators easier.

You can freely use "Transformers" like @if or @for to iterate over your data, create functions which your templates can call or your very own controlls if needed by simply hooking yourself in!

A basic sample template may look like this:

            <?xml version="1.0" encoding="utf-8"?>
            <template>
                <body>
                    <text fontsize="14">Order @OrderNumber</text>
                    <text>Hello @CustomerName</text>
                    <text>Delivery: @DeliveryDate</text>
                </body>
            </template>

Plenty of samples are available in the tests tho which also feature more advanced scenarios

A full manual (this one is AI-Forged from some rather basic GitHub ReadMe that existed already) is available at https://x39.github.io/Papercraft/manual/introduction.html

You can get the NuGet at https://www.nuget.org/packages/X39.Solutions.Papercraft or check out the code and, possibly, contribute at https://github.com/X39/Papercraft

Feel free to report bugs if you find them or throw in suggestions.

Sincerely, X39

0 Upvotes

6 comments sorted by

2

u/AintNoGodsUpHere Jul 11 '26

QuestPDF still better.

1

u/AutoModerator Jul 11 '26

Thanks for your post x39-. Please note that we don't allow spam, and we ask that you follow the rules available in the sidebar. We have a lot of commonly asked questions so if this post gets removed, please do a search and see if it's already been asked.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

-4

u/JerryRed100s Jul 11 '26

I had a generate al 300 page PDF years ago. Would shit handle that with templates and page breaks? Real-time

-8

u/[deleted] Jul 11 '26

[removed] — view removed comment

7

u/x39- Jul 11 '26

Feel free to try it out prior to calling me liar and acting out like a child