Pryzmera – Fast PDF viewer fully rendering on the GPU

By hackernews · · Showcase

In September of 2021, my father told me he was struggling to open PDFs. As part of his job, he had to view many PDFs with millions of vector paths that were generated by CAD software, and we could not find any PDF viewer that would render them at more than a few frames per second. I thought that if we simply converted those paths into triangles the GPU could just blast through them. Today, after more than 5 years and 3 iterations in 3 different languages, I would like to share with you the 3rd iteration of my PDF viewer: Named "Pryzmera", I wrote it by hand with the goal to render those CAD PDFs at interactive frame rates, and with the intention to make every feature as fast as I could possibly imagine it to be. When Pryzmera opens a document, it first starts by interpreting each page. As a page is interpreted, it generates small clipping & tessellation jobs that run in parallel. Clipping & tessellation is performed by Pryzmera's own tessellator and produces the initial geometry for the page. This geometry is then collected and jointly optimized to produce a final GPU representation that mostly consists of colored/textured triangles. The representation is completely static, which in turn makes rendering performance (FPS) almost static, even when the view changes (e.g. panning/zooming/rotating). Once the representation is uploaded to the GPU, rendering a page typically requires only 3-4 draw calls. On my machine (GTX1080/i7-5820k), Pryzmera can render my father's CAD PDFs a

In September of 2021, my father told me he was struggling to open PDFs.

As part of his job, he had to view many PDFs with millions of vector paths that were generated by CAD software,

and we could not find any PDF viewer that would render them at more than a few frames per second.

I thought that if we simply converted those paths into triangles the GPU could just blast through them.

Today, after more than 5 years and 3 iterations in 3 different languages,

I would like to share with you the 3rd iteration of my PDF viewer:

Named "Pryzmera", I wrote it by hand with the goal to render those CAD PDFs at interactive frame rates,

and with the intention to make every feature as fast as I could possibly imagine it to be.

When Pryzmera opens a document, it first starts by interpreting each page.

As a page is interpreted, it generates small clipping & tessellation jobs that run in parallel.

Clipping & tessellation is performed by Pryzmera's own tessellator and produces the initial geometry for the page.

What Hacker News is saying

  • “What do you use for conformance and regression testing?”
  • “$60 for a closed source PDF viewer, with 1 year of updates.”
  • “Is PDF performance a problem?”
  • “> https://pryzmera.com/stress_test.pdf the stress test renders in < 3 seconds on my m5 max in pdfcraft (which is open source).”

Read the full discussion on Hacker News →

Source: https://pryzmera.com/

More stories