Products Technologies Demo Docs Blog Support Company

New Sample: Building a Print Preview for TX Text Control .NET for WPF

A print preview control, that can be compared to the Windows Forms print preview control, is not part of the standard WPF control set. 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…

New Sample: Building a Print Preview for TX Text Control .NET for WPF

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.

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

GitHub

Download and Fork This Sample on GitHub

We proudly host our sample code on github.com/TextControl.

Please fork and contribute.

Download ZIP

Open on GitHub

Open in Visual Studio

Requirements for this sample

  • Visual Studio 2012 or better
  • TX Text Control .NET for WPF (trial sufficient)

Related Posts

ASP.NETWindows FormsPrinting

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.


ASP.NETJavaScriptPDF

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.


ASP.NETJavaScriptPDF

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.


ASP.NETDockerGitHub

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.


ASP.NETWindows FormsWPF

Official TX Text Control .NET Sample Applications Are Now Hosted on GitHub

This article gives a quick overview of the new repositories, their structure and our plans for the future.