DEV Community

Timur Bekir BULUT
Timur Bekir BULUT

Posted on

I built a GPU-accelerated PDF renderer from scratch in C++

I've been working on a project called ManasPDF — a PDF rendering engine written from scratch in C++ that uses Direct2D for GPU-accelerated rendering.

Why?

Most PDF libraries are either expensive or slow. I wanted to see if I could build one from scratch with hardware-accelerated rendering. Turns out, you can — but it takes implementing 90+ PDF operators to get there.

What it does

  • GPU rendering via Direct2D with automatic CPU fallback
  • Font rasterization with FreeType (TrueType, CFF, Type1, Type3)
  • 7 image codecs (JPEG, JPEG2000, Flate, LZW, CCITT Fax, ASCII85, RunLength)
  • AES-256 and PKCS#7 certificate encryption
  • Glyph-level text extraction
  • Page render cache (500MB), glyph cache (128MB)

Tech stack

Component Technology
Render Engine Direct2D (GPU) + FreeType
Platform .NET 8.0 / WPF
Native Core C++ (ManasPDFCore.dll)
License Apache 2.0

Use it in your projects

Available as a NuGet package:

dotnet add package ManasPDF --prerelease
dotnet add package ManasPDF.Wpf --prerelease
Enter fullscreen mode Exit fullscreen mode

What's next

Currently focused on getting the rendering solid. Once viewing is complete, I'm planning to add PDF editing capabilities.

It's alpha stage — expect some rough edges with complex PDFs. Would love feedback, especially broken PDFs to test against.

GitHub: github.com/Informal061/ManasPDF
Website: thebigstudio.net/en/ManasPDF

Top comments (0)