Share via

QuestPDF issue

Jonathan 210 Reputation points
2026-06-17T05:27:33.4066667+00:00

Hi,

Can you help for the issues below? I did the change to add "Type" but still the same problem.

User's image

Developer technologies | .NET | .NET Multi-platform App UI
0 comments No comments

Answer accepted by question author

Sumesh Ramasamy 0 Reputation points
2026-06-17T05:55:43.99+00:00

Hello,

Welcome to the Microsoft Q&A and thank you for posting your question here.

I understand that you are still getting errors after adding Type for the QuestPDF license configuration in your .NET MAUI project.

From the screenshot, the main issue is that the code is placed directly inside the class body, but it needs to be inside the CreateMauiApp() method. Also, the QuestPDF license setting should be QuestPDF.Settings.License, not QuestPDF.Settings.LicenseType.

Please update your MauiProgram.cs like this:

using CommunityToolkit.Maui;
using QuestPDF.Infrastructure;

namespace Handle_PDF_MauiApp1;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        QuestPDF.Settings.License = LicenseType.Community;

        var builder = MauiApp.CreateBuilder();

        builder
            .UseMauiApp<App>()
            .UseMauiCommunityToolkit();

        return builder.Build();
    }
}

Also, please make sure the .NET MAUI Community Toolkit NuGet package is installed in your project. Otherwise, UseMauiCommunityToolkit() will still show an error.

So the key changes are:

Put the code inside public static MauiApp CreateMauiApp()

Use QuestPDF.Settings.License = LicenseType.Community;

Make sure using QuestPDF.Infrastructure; is added

Make sure using CommunityToolkit.Maui; is added

Confirm that the CommunityToolkit.Maui NuGet package is installed

You can also refer to the official QuestPDF license configuration documentation here: https://www.questpdf.com/license/configuration.html

And the .NET MAUI Community Toolkit setup documentation here: https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/get-started

I hope this is helpful. Please let me know if you have any other questions, steps or clarifications.

Please don’t forget to close the thread by upvoting and accepting it as an answer if it is helpful.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.