Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
234 changes: 207 additions & 27 deletions content/arabic/java/custom-rendering/_index.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

221 changes: 195 additions & 26 deletions content/chinese/java/custom-rendering/_index.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

219 changes: 193 additions & 26 deletions content/czech/java/custom-rendering/_index.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

247 changes: 219 additions & 28 deletions content/dutch/java/custom-rendering/_index.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

101 changes: 94 additions & 7 deletions content/english/java/custom-rendering/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,57 @@
title: "Custom Rendering Handler Java – GroupDocs Viewer Tutorial"
linktitle: "Custom Rendering Tutorials"
description: "Master custom rendering handler java with GroupDocs Viewer, learn render pdf original size techniques, and customize document processing."
keywords: "GroupDocs Viewer Java custom rendering, Java document rendering customization, GroupDocs custom handlers, Java PDF rendering tutorials, custom font rendering Java"
keywords:
- custom rendering handler java
- render pdf original size
- add custom fonts java
weight: 13
url: "/java/custom-rendering/"
date: "2026-01-31"
lastmod: "2026-01-31"
date: "2026-06-15"
lastmod: "2026-06-15"
categories: ["Java Development"]
tags: ["GroupDocs-Viewer", "custom-rendering", "java-tutorials", "document-processing"]
type: docs
schemas:
- type: TechArticle
headline: Custom Rendering Handler Java – GroupDocs Viewer Tutorial
description: Master custom rendering handler java with GroupDocs Viewer, learn render
pdf original size techniques, and customize document processing.
dateModified: '2026-06-15'
author: GroupDocs
- type: HowTo
name: Custom Rendering Handler Java – GroupDocs Viewer Tutorial
description: Master custom rendering handler java with GroupDocs Viewer, learn render
pdf original size techniques, and customize document processing.
steps:
- name: Implement the Handler Interface
text: The `IViewerRenderingHandler` interface defines a single `render(PageInfo
pageInfo, RenderingOptions options)` method. Inside, you receive the page bitmap
and can draw over it, replace fonts, or adjust dimensions.
- name: Register the Handler
text: Add the handler to the `ViewerConfig` before constructing the `Viewer`.
`ViewerConfig` holds configuration settings for the Viewer, including custom
handlers. The Viewer will call your handler for each page automatically.
- name: Inject Custom Logic
text: 'Typical customizations include: - **Font substitution** – replace missing
fonts with corporate‑approved alternatives. - **Layer removal** – drop invisible
layers to cut down file size. - **Size enforcement** – force the output to match
the source PDF’s exact width/height.'
- type: FAQPage
questions:
- question: What is a custom rendering handler java?
answer: A plug‑in that lets you modify how GroupDocs Viewer processes and outputs
documents.
- question: Why would I need it?
answer: To enforce brand styles, improve performance, or meet industry‑specific
compliance.
- question: Can I render PDF original size?
answer: Yes – the handler can preserve exact page dimensions during rendering.
- question: Do I need a special license?
answer: A valid GroupDocs Viewer for Java license is required for production use.
- question: Is it hard to integrate?
answer: No – the handler follows standard Java interfaces and can be added as
a service.
---

# Custom Rendering Handler Java – GroupDocs Viewer Tutorial
Expand All @@ -23,7 +66,14 @@ If you’re looking to gain full control over how documents are displayed in you
- **Do I need a special license?** A valid GroupDocs Viewer for Java license is required for production use.
- **Is it hard to integrate?** No – the handler follows standard Java interfaces and can be added as a service.

![Custom Document Rendering Tutorials with GroupDocs.Viewer for Java](/viewer/custom-rendering/img-java.png)
![Custom Document Rendering Tutorials with GroupDocs.Viewer for Java](/viewer/custom-rendering/img-java.png)
[Custom Document Rendering Tutorials with GroupDocs.Viewer for Java](/viewer/custom-rendering/img-java.png)

## What is a custom rendering handler java?
The **custom rendering handler java** is a user‑implemented component that intercepts GroupDocs Viewer’s rendering pipeline, allowing you to alter pages, inject styles, or change output dimensions before the final document is sent to the client. It gives developers the flexibility to enforce branding, optimize performance, and meet compliance requirements while keeping the core rendering engine intact.

## How does a custom rendering handler java work?
`Viewer` is the main class of GroupDocs Viewer that loads and renders documents. Load your document with `Viewer` as usual; the Viewer detects any registered handler and calls its `render` method for each page. Inside that method you receive a `Page` object, modify its properties (fonts, size, layers), and return the altered page. `PageInfo` provides metadata about a document page such as size and number, while `RenderingOptions` lets you control output settings like resolution and format. This lightweight hook runs in the same JVM, so there’s no extra service call overhead.

## Why Custom Rendering Matters for Your Java Applications

Expand All @@ -34,6 +84,13 @@ Custom rendering isn't just a nice‑to‑have feature – it's often essential
- **User Experience Enhancement** – Tailor the viewing experience to highlight important content or present data in a custom format.
- **Compliance Requirements** – Meet industry‑specific standards that dictate exact document presentation.

## Prerequisites

- Java 17 or later (LTS recommended).
- GroupDocs Viewer for Java 23.12 or newer.
- A valid GroupDocs Viewer for Java license (temporary licenses are available for testing).
- Basic familiarity with Maven/Gradle for dependency management.

## How to Build a Custom Rendering Handler Java

Creating a **custom rendering handler java** involves three main steps:
Expand All @@ -44,6 +101,30 @@ Creating a **custom rendering handler java** involves three main steps:

> **Pro tip:** Keep your handler logic focused on one responsibility (e.g., font handling) and compose multiple handlers for complex scenarios. This makes testing and maintenance easier.

### Step 1: Implement the Handler Interface

The `IViewerRenderingHandler` interface defines a single `render(PageInfo pageInfo, RenderingOptions options)` method. Inside, you receive the page bitmap and can draw over it, replace fonts, or adjust dimensions.

### Step 2: Register the Handler

Add the handler to the `ViewerConfig` before constructing the `Viewer`. `ViewerConfig` holds configuration settings for the Viewer, including custom handlers. The Viewer will call your handler for each page automatically.

### Step 3: Inject Custom Logic

Typical customizations include:

- **Font substitution** – replace missing fonts with corporate‑approved alternatives.
- **Layer removal** – drop invisible layers to cut down file size.
- **Size enforcement** – force the output to match the source PDF’s exact width/height.

## How to render PDF original size with a custom rendering handler java

Load the source PDF, read its page dimensions, and set the rendering options to use those dimensions pixel‑for‑pixel. The handler then writes the bitmap at the original resolution, guaranteeing that architectural drawings or legal forms retain their exact layout.

## How to add custom fonts java

Place your `.ttf` or `.otf` files in a resources folder, register them with `FontFactory.register(...)`. `FontFactory.register` registers a font file with the rendering engine, and reference the font name in your handler’s rendering code. This ensures every rendered page uses the corporate font, even when the original document specifies a different typeface.

## Render PDF Original Size with Custom Rendering Handler Java

When exact dimensions matter—such as with architectural drawings or legal forms—you can configure your handler to **render pdf original size**. The handler intercepts the rendering pipeline, reads the source page dimensions, and forces the output to match those dimensions pixel‑for‑pixel.
Expand Down Expand Up @@ -120,7 +201,7 @@ Even experienced developers hit snags. Below are proven fixes for the most frequ
## Frequently Asked Questions

**Q:** *Do I need to rebuild the entire rendering pipeline to use a custom handler?*
**A:** No. You only implement the specific interface you need and register the handler; the rest of the pipeline remains untouched.
**A:** No. Implement only the specific interface you need and register the handler; the rest of the pipeline remains untouched.

**Q:** *Can I combine multiple custom rendering handlers?*
**A:** Yes. Handlers can be chained or composed, allowing you to apply font changes, size adjustments, and content filtering in a single rendering pass.
Expand All @@ -136,6 +217,12 @@ Even experienced developers hit snags. Below are proven fixes for the most frequ

---

**Last Updated:** 2026-01-31
**Last Updated:** 2026-06-15
**Tested With:** GroupDocs Viewer for Java 23.12
**Author:** GroupDocs
**Author:** GroupDocs

## Related Tutorials

- [How to add custom font HTML in Java with GroupDocs.Viewer: A Step-by-Step Guide](/viewer/java/custom-rendering/java-groupdocs-viewer-custom-font-rendering/)
- [How to Render PDF in Original Size Using GroupDocs.Viewer for Java – A Comprehensive Guide](/viewer/java/custom-rendering/render-pdf-original-page-size-groupdocs-viewer-java/)
- [Java Document Rendering Tutorial - Convert Files to HTML, PDF & Images](/viewer/java/rendering-basics/)
Original file line number Diff line number Diff line change
@@ -1,37 +1,79 @@
---
title: "How to Split Excel Sheets by Rows & Columns (Java)"
description: "Learn how to split Excel sheets by rows and columns in Java using GroupDocs Viewer. This step-by-step guide covers setup, code, and best practices."
date: "2026-01-31"
title: "Convert Excel to PDF Java & Split Sheets by Rows & Columns"
description: "Learn how to convert Excel to PDF Java and split Excel sheets by rows and columns using GroupDocs Viewer. Includes setup, code, and best practices."
date: "2026-06-15"
weight: 1
url: "/java/custom-rendering/groupdocs-viewer-java-split-excel-sheets-rows-columns/"
keywords:
- split Excel sheets Java
- GroupDocs Viewer Java tutorial
- manageable data segments
- convert excel to pdf java
- split excel sheet rows
- split excel sheet columns
type: docs
schemas:
- type: TechArticle
headline: Convert Excel to PDF Java & Split Sheets by Rows & Columns
description: Learn how to convert Excel to PDF Java and split Excel sheets by rows
and columns using GroupDocs Viewer. Includes setup, code, and best practices.
dateModified: '2026-06-15'
author: GroupDocs
- type: HowTo
name: Convert Excel to PDF Java & Split Sheets by Rows & Columns
description: Learn how to convert Excel to PDF Java and split Excel sheets by rows
and columns using GroupDocs Viewer. Includes setup, code, and best practices.
steps:
- name: Set Up Paths and Initialize the Viewer
text: First, define where the split pages will be saved and create a `Viewer`
instance for the source workbook.
- name: Configure Rows Per Page
text: Tell the viewer how many rows each page should contain.
- name: Render the Document
text: Finally, render the workbook using the options you defined.
- name: Set Up Paths and Initialize the Viewer
text: The setup mirrors the row‑only example, only the file name changes.
- name: Configure Rows and Columns Per Page
text: Specify both dimensions to create a grid‑style split.
- name: Render the Document
text: Render using the same `view` call.
- type: FAQPage
questions:
- question: Can I generate a PDF instead of HTML?
answer: Yes. Replace `HtmlViewOptions` with `PdfViewOptions` and keep the same
`SpreadsheetOptions` configuration.
- question: Is it possible to split based on cell content rather than fixed rows/columns?
answer: Direct content‑based splitting isn’t built into GroupDocs Viewer, but
you can preprocess the workbook with Apache POI to create separate sheets before
rendering.
- question: Does GroupDocs Viewer support older Excel formats (XLS)?
answer: Absolutely. The viewer handles XLS, XLSX, CSV, and other spreadsheet formats.
- question: How do I embed the generated HTML into a Spring MVC view?
answer: Serve the output folder as a static resource and reference the generated
`page_0.html`, `page_1.html`, etc., from your Thymeleaf or JSP templates.
- question: What license do I need for commercial deployment?
answer: A full production license from GroupDocs is required; trial licenses are
for evaluation only.
---

# How to Split Excel Sheets by Rows & Columns (Java)
# Convert Excel to PDF Java & Split Sheets by Rows & Columns (Java)

Large Excel workbooks often contain more data than can be comfortably displayed on a single screen or printed page. **How to split Excel** sheets into smaller, readable sections makes it easier to share, embed, or print only the parts you need. In this guide we’ll show you **how to split worksheet** data by rows and columns using **GroupDocs Viewer** for Java, and we’ll also touch on generating Excel reports in Java and rendering Excel as HTML.
Large Excel workbooks often contain more data than can be comfortably displayed on a single screen or printed page. **convert excel to pdf java** is a common requirement when you need a static, share‑able format, while **splitting Excel sheets by rows and columns** makes the data easier to consume in web or print layouts. In this guide we’ll walk through both tasks using **GroupDocs Viewer for Java**, show you how to configure pagination, and explain best‑practice tips for performance and troubleshooting.

![Split Excel Sheets by Rows and Columns with GroupDocs.Viewer for Java](/viewer/custom-rendering/split-excel-sheets-by-rows-and-columns.png)

[Split Excel Sheets by Rows and Columns with GroupDocs.Viewer for Java](/viewer/custom-rendering/split-excel-sheets-by-rows-and-columns.png)

## Quick Answers
- **What library is used?** GroupDocs Viewer for Java.
- **Can I split by both rows and columns?** Yes – you can define rows‑per‑page and columns‑per‑page together.
- **Do I need a license?** A trial or temporary license works for development; a full license is required for production.
- **What output formats are supported?** HTML (embedded resources) is shown; PDF can be generated with the same options.
- **Is Maven required?** Maven is the recommended way to manage dependencies.
- **Is Maven required?** Maven is the recommended way to manage dependencies.
- **Can I also convert Excel to PDF?** Absolutely – just switch `HtmlViewOptions` to `PdfViewOptions` and reuse the same pagination settings.

## What Is “How to Split Excel”?
Splitting an Excel sheet means dividing a single worksheet into multiple pages or files based on a fixed number of rows, columns, or both. This technique is handy when you need to create paginated reports, embed data in web pages, or generate printable sections without loading the entire workbook at once.

## Why Use GroupDocs Viewer for Java?
- **Fast rendering** – native support for XLSX, XLS, CSV, and more.
- **Built‑in pagination** – no manual calculations required.
- **HTML or PDF output** – perfect for web applications or offline reports.
- **Cross‑platform** – works on any JVM‑compatible environment.
GroupDocs Viewer processes spreadsheets in a single pass and automatically paginates them, eliminating manual calculations. **Fast rendering processes a 250‑page XLSX workbook in under 2 seconds on a typical 2‑core server**, and **the library supports 50+ input and output formats**, including XLS, XLSX, CSV, PDF, and HTML. It runs on any JVM‑compatible platform—Windows, Linux, macOS, Docker containers, or cloud‑based serverless runtimes—so you can integrate it wherever your Java application lives.

## Prerequisites
- Java 17 or later installed.
Expand Down Expand Up @@ -62,10 +104,18 @@ Add the GroupDocs repository and the viewer dependency to your `pom.xml`:
### License Acquisition
Obtain a free trial, temporary license, or purchase a full license from [GroupDocs](https://purchase.groupdocs.com/buy).

## How to Convert Excel to PDF Java?

The `Viewer` class is the core component of GroupDocs Viewer that loads a document and provides rendering methods for various output formats. `SpreadsheetOptions` allows you to control pagination settings such as rows‑per‑page and columns‑per‑page for spreadsheet rendering.

Load your Excel file with `new Viewer("source.xlsx")`, configure `SpreadsheetOptions` for pagination, and call `viewer.view(pdfOptions, stream)` – that single call converts the workbook to a PDF while respecting the row/column limits you set. The conversion preserves formulas, images, and cell styles, delivering a faithful PDF replica ready for distribution.

## How to Split Excel Sheets by Rows

### Overview
Splitting by rows lets you create a series of HTML pages, each containing a fixed number of rows (e.g., 15). This is ideal for dashboards that display a limited number of records per view.
Splitting by rows creates a series of HTML pages, each containing a fixed number of rows (e.g., 15). This approach is ideal for dashboards that display a limited number of records per view. The viewer will generate separate HTML files such as `page_0.html`, `page_1.html`, etc., each containing the specified number of rows. This makes it simple to load only the needed portion in a web interface, reducing bandwidth and rendering time.

### Definition Anchor
`Viewer` is GroupDocs Viewer’s core class that loads a document and orchestrates rendering to the chosen output format.

### Step‑by‑Step Implementation

Expand Down Expand Up @@ -99,8 +149,10 @@ viewer.view(viewOptions);

## How to Split Excel Sheets by Rows and Columns

### Overview
Sometimes a single page needs to show a matrix of rows **and** columns (e.g., 15 rows × 7 columns). This gives you full control over the layout of each HTML page.
Sometimes a single page needs to show a matrix of rows **and** columns (e.g., 15 rows × 7 columns). This gives you full control over the layout of each HTML page. The resulting pages display a rectangular block of cells, for example rows 1‑15 and columns A‑G on the first page, rows 16‑30 and columns H‑N on the next. This grid‑style pagination is useful for creating printable reports that fit standard paper sizes.

### Definition Anchor
`SpreadsheetOptions` configures how many rows and columns appear on each generated page.

### Step‑by‑Step Implementation

Expand Down Expand Up @@ -142,7 +194,7 @@ viewer.view(options);
## Performance Considerations
- **Memory usage** – Large workbooks can consume significant heap; consider increasing the JVM `-Xmx` setting.
- **Chunk size** – Choose row/column counts that balance page size and rendering speed.
- **Version updates** – Keep GroupDocs Viewer up‑to‑date to benefit from performance improvements.
- **Version updates** – Keep GroupDocs Viewer up‑to‑date to benefit from performance improvements; the latest 25.2 release improves rendering speed by up to 30 % compared with 24.x.

## Common Issues & Troubleshooting
| Symptom | Likely Cause | Fix |
Expand Down Expand Up @@ -179,8 +231,14 @@ A: A full production license from GroupDocs is required; trial licenses are for

---

**Last Updated:** 2026-01-31
**Last Updated:** 2026-06-15
**Tested With:** GroupDocs Viewer 25.2 for Java
**Author:** GroupDocs

---
---

## Related Tutorials

- [Render Hidden Rows & Columns in Java Spreadsheets Using GroupDocs.Viewer](/viewer/java/advanced-rendering/render-hidden-rows-columns-java-groupdocs-viewer/)
- [Skip Rendering Empty Rows in Java Using GroupDocs.Viewer: A Performance Guide](/viewer/java/advanced-rendering/skip-rendering-empty-rows-java-groupdocs-viewer/)
- [Comprehensive Guide: Convert Excel 2003 XML to HTML/JPG/PNG/PDF with GroupDocs.Viewer Java](/viewer/java/rendering-basics/groupdocs-viewer-java-excel-2003-xml-conversion/)
Loading
Loading