DEV Community

Hisa Araki
Hisa Araki

Posted on

Why I built a pixel-perfect report engine with Rust and Skia

Introduction

For many years, I have been working on business systems where report generation is a critical component.

However, I repeatedly encountered the same problems:

  • Layout differences depending on printer drivers
  • OS-specific rendering inconsistencies
  • Difficulty achieving true WYSIWYG output

These issues are not new, but they are still not fully solved.

The Problem

In traditional report systems, rendering often depends on external components such as printer drivers or OS-level graphics APIs.

This leads to:

  • Slight layout shifts
  • Inconsistent text measurement
  • Different output between environments

For business reports, even small differences can be unacceptable.

The Approach

To solve this, I designed a report engine with the following principles:

  • Fully deterministic layout
  • Pixel-perfect rendering
  • No dependency on printer drivers
  • Cross-platform consistency

The engine directly controls rendering using Skia.

Why Rust

I chose Rust for:

  • Memory safety
  • Predictable performance
  • Strong control over low-level behavior

This is important for a rendering engine where consistency is critical.

Technical Highlights

  • Layout engine with pre-calculated positioning
  • Pagination control
  • Consistent font measurement
  • Rendering abstraction over Skia

Result

The engine produces identical output (PDF / PNG) across environments.

Repository

https://github.com/acrossreport

Closing

If you are interested in rendering engines, Skia, or cross-platform layout systems, I would appreciate your feedback.

Top comments (0)