ASP.NET Rich Text Editor (for WebForms, MVC, .NET Core and Bootstrap) - New Client HTML Printing

ASP.NET Team Blog
28 June 2019

In our most recent update (v19.1), we added client HTML printing support to our ASP.NET Rich Text Editor (this support is available to WebForms, MVC, Core, and Bootstrap versions of the control library).

Why New Client-side Printing?

In previous versions, our Rich Text Editor shipped with server-side printing support (for purposes of this blog post, I’ll refer to our old implementation as server-side printing). When printing was initiated on the server, our RichEdit Document Server generated a PDF document on the server using a server-side document model. Once prepared, the browser downloaded the document for subsequent printing.

The primary disadvantage of server-side printing is that the server-side document model does not have exact document layout information from the client-side. As a result, the PDF file’s layout differs from the one displayed within the browser. For example, if you print the following text block in our Rich Text Editor:

ASPNET-RichEdit-ClientPrinting

      you’ll obtain a slightly different result in the PDF file:

ASPNET-RichEdit-ClientPrinting

Though these differences may seem inconsequential, they are essential for some of our customers. Our new client-side printing engine resolves these minor discrepancies so that end-users can print what they see on-screen.

The Basics of Our New Client-side Printing Engine

Client-side HTML printing doesn’t initiate any server requests. Our Rich Text Editor opens a new browser tab, renders document layout (HTML markup) within this tab and activates the default print dialog of the web browser.

How to Enable Client HTML Printing

Please note that server-side printing is enabled by default. To switch your apps to client-side printing, set the PrintMode property to ClientHtml:

ASPxRichEdit1.Settings.Printing.PrintMode = PrintMode.ClientHtml;

Once you start using our client-side printing option, the same text block that was slightly altered when sent to PDF (server-side printing), is now identical to that displayed within the browser:

ASPNET-RichEdit-ClientPrinting

See Print Out a Document for more information on this new client-side printing option.

Limitations

  • Client-side print performance is driven by document size and information complexity. Simple documents are printed faster than the server-side counterpart. Complex documents may take longer to print.
  • Paper format in Printer settings must be the same as the paper format used in the RichEdit (otherwise, the browser will split content incorrectly).

Feedback

We want to hear your thoughts. Please tell us what you think of this new capability and how you expect to use it in an upcoming project. Are you currently happy with our server-side print implementation? Do you expect to you use this new client-side print option?

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.