Render print areas
This article explains how to view Spreadsheet print areas with GroupDocs.Viewer within your Java applications.
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.
GroupDocs.Viewer provides 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.
Viewer viewer = new Viewer("sample.xlsx"); HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources(); viewOptions.setSpreadsheetOptions(SpreadsheetOptions.forRenderingPrintArea()); viewer.view(viewOptions); viewer.close();
You may easily run the code above and see the feature in action in our GitHub examples:
- GroupDocs.Viewer for Java examples, plugins, and showcase
- Document Viewer for .NET App WebForms UI Modern Example
- Document Viewer for Java App Dropwizard UI Modern Example
- Document Viewer for Java Spring UI Example
- GroupDocs.Viewer for .NET samples, plugins and showcase
- Document Viewer for .NET MVC UI Example
Free Online App
Along with full-featured Java 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.