New Sample: Building a Print Preview for TX Text Control .NET for WPF
WPF does not include a built-in print preview control comparable to the one in Windows Forms. This sample project uses the TX Text Control Page Rendering Engine to render each document page as a FixedPage, then displays the resulting FixedDocument inside the standard WPF DocumentViewer.

In order to preview what is actually printed, a WPF DocumentViewer can be used. Generally, this document viewer renders WPF FixedDocuments. Due to TX Text Control's special WYSIWYG rendering, TextControl can't be connected to this viewer directly.
Anyway, it is quite easy to utilize this out-of-the-box viewer effectively as a print preview control using TX Text Control's Page Rendering Engine. Each page is rendered on a FixedPage of the FixedDocument and displayed in the standard viewer.
Download the sample from GitHub and test it on your own.
![]()
Download and Fork This Sample on GitHub
We proudly host our sample code on github.com/TextControl.
Please fork and contribute.
Requirements for this sample
- Visual Studio 2012 or better
- TX Text Control .NET for WPF (trial sufficient)
Related Posts
Building a TX Text Control Project with GitHub Actions and the Text Control…
This tutorial provides a step-by-step guide to setting up a clean, reproducible environment using GitHub Actions. It starts with a brand-new project and ends with a fully automated build and test…
Print MS Word DOCX Documents in .NET using C# Without Interop
This article shows how to print MS Word DOCX documents in .NET using C#. It uses TX Text Control to load Office Open XML documents and print them to any printer, PDF or image file.
Extract Data from PDF Documents with C#
Learn how to extract text from PDF documents using the TX Text Control PDF import feature in C#. This article shows how to extract text, attachments, form field values and metadata from PDF documents.
Inject JavaScript to PDF Documents in C#
Learn how to inject JavaScript into PDF documents using TX Text Control .NET Server. This article shows how to add JavaScript to a PDF document to execute code when the document is opened.
Creating an ASP.NET Core Web App with Docker Support and GitHub Packages
This article shows how to create an ASP.NET Core Web App with Docker support. The TX Text Control NuGet packages are hosted on GitHub Packages to get restored during the build process.

