QuestPDF/QuestPDF · warning · NotSupportedException

The Previewer application is no longer supprted. Please use

Error message

The Previewer application is no longer supprted. Please use a new QuestPDF Companion application by calling ShowInCompanion() or ShowInCompanionAsync() methods.

What it means

The legacy ShowInPreviewer synchronous extension is marked [Obsolete] and unconditionally throws NotSupportedException with the deprecation message. The old Previewer app was replaced by the QuestPDF Companion; this stub exists only to surface a clear migration error at runtime.

Source

Thrown at src/dotnet/library/QuestPDF/Companion/Previewer.cs:20

using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using QuestPDF.Companion;
using QuestPDF.Drawing;
using QuestPDF.Infrastructure;

namespace QuestPDF.Previewer;

public static class PreviewerExtensions
{
    private const string ObsoleteMessage = "The Previewer application is no longer supprted. Please use a new QuestPDF Companion application by calling ShowInCompanion() or ShowInCompanionAsync() methods.";
    
    [Obsolete(ObsoleteMessage)]
    [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
    [ExcludeFromCodeCoverage]
    public static void ShowInPreviewer(this IDocument document, int port = 12500)
    {
        throw new NotSupportedException(ObsoleteMessage);
    }

    [Obsolete(ObsoleteMessage)]
    [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
    [ExcludeFromCodeCoverage]
    public static Task ShowInPreviewerAsync(this IDocument document, int port = 12500, CancellationToken cancellationToken = default)
    {
        throw new NotSupportedException(ObsoleteMessage);
    }
}

View on GitHub (pinned to 43ab125596)

Solutions

  1. Replace ShowInPreviewer() with ShowInCompanion() (or the async variant) and run on .NET 8+.
  2. Remove all references to the QuestPDF.Previewer namespace / ShowInPreviewer usings.
  3. Update docs/tutorials to the Companion API.

Example fix

// before:
doc.ShowInPreviewer();

// after:
doc.ShowInCompanion();
Defensive patterns

Strategy: validation

Validate before calling

// Simply do not call ShowInPreviewer; use the Companion API.
document.ShowInCompanion();

Prevention

When it happens

Trigger: Calling document.ShowInPreviewer() on any current QuestPDF version. The method body only throws - it performs no work.

Common situations: Carrying forward code from an older QuestPDF version that used the Previewer; following an outdated tutorial/sample that calls ShowInPreviewer.

Related errors


AI-assisted analysis of QuestPDF/QuestPDF@43ab125596 (2026-08-13). Data as JSON: /api/errors/d38b7fe3cece2c9e. Report an issue: GitHub.