Optimize spreadsheets in a PDF file

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Viewer MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-viewer -- dnx GroupDocs.Viewer.Mcp --yes
Folders, licensing and more →

On this page

This optimization allows to reduce the output file size by setting up border lines. Besides that, it removes the Arial and Times New Roman characters of 32-127 codes.

The default value is false.

The following code snippet shows how to optimize spreadsheets in a PDF file:

try (Viewer viewer = new Viewer("invoice.xlsx")) {
    PdfViewOptions viewOptions = new PdfViewOptions();
    PdfOptimizationOptions optimizationOptions = new PdfOptimizationOptions();
    optimizationOptions.setOptimizeSpreadsheets(true);
    viewOptions.setPdfOptimizationOptions(optimizationOptions);
    viewer.view(viewOptions);
}

On this page