Render print areas

This article explains how to view Spreadsheet print areas with GroupDocs.Viewer within your .NET applications.

Introduction

Spreadsheet document allows to set a print area if you want to print a specific section on a worksheet. There can be the case when you want to render only the print area of the worksheet using GroupDocs.Viewer. 

The Solution

GroupDocs.Viewerprovides an option to render sections of the worksheet(s) defined as the “print area”. It renders each print area in a worksheet as a separate page. The following code samples show how to render only the print areas from worksheets.

            using (Viewer viewer = new Viewer("sample.xlsx"))
            {
                HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources();
                viewOptions.SpreadsheetOptions = SpreadsheetOptions.ForRenderingPrintArea();
                viewer.View(viewOptions);
            }

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App

Along with full-featured .NET library we provide simple but powerful free Apps. You are welcome to view Word, PDF, Excel, PowerPoint documents with free to use online GroupDocs Viewer App.