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 at hundreds (and sometimes thousands) of frames per second. Compared to Adobe Acrobat:
- Loading is about 2-10x faster (depending on how Acrobat is feeling on the day)
- Rendering is about 1200-5700x faster (depending on Pryzmera's graphics settings)
- Text search is about 100x faster (although it's hard to measure Acrobat's performance here)
- And this trend continues...
If you would like to test the performance yourself, you can press F8 to bring up the render stats, including FPS and VRAM usage breakdown; You can try this stress-test file I made that is rather representative of the PDFs generated by CAD software: https://pryzmera.com/stress_test.pdf
And if you are curious about any of the technical details, or anything else, ask away!
For a PDF viewer, fidelity matters much more than rendering speed. Imagine using it to open CAD PDFs as you suggested, only to realize a few months later that sections of some files silently failed to render, by which point the ship has sailed.
Relying on a renderer maintained by a single person or even a small team carries significant risks. There are too many things that can go wrong.
For example, pdf.js (which powers Firefox) uses a test suite with 1,579 files and growing: https://github.com/mozilla/pdf.js/tree/master/test/pdfs
As for visual features Pryzmera currently doesn't support, the biggest one is probably shading; it's very rare in my test suite, but I will probably add support in the future, I just haven't got to it yet. Other visual features like paths, images, text, image masks and transparency are fully supported.
Lastly, I would like to add that fidelity is not absolutely everything: when you can't open a PDF, it doesn't help that it will eventually render correctly. Effectively you are not getting any render at all. Pryzmera does its best to render as close to the spec as possible, but is willing to sacrifice some visual fidelity (for example, by flattening curves into multiple line segments) in order to achieve orders of magnitude better performance. And if something does fail to render, it should appear in the logs, excluding bugs of course.
I did my best to tune text rendering to look as good as it can be, but it's certainly not perfect. You can try raising the text rendering quality from the graphics settings (lets say to 64), reload the document with F5, and see if it looks better.
the stress test renders in < 3 seconds on my m5 max in pdfcraft (which is open source). Not sure I would ever pay $60 for a closed-source app to "speed it up," especially given how contrived that stress-test PDF is.
> GTX1080/i7-5820k
Yeah, there's your problem. Computers have gotten substantially faster in the last dozen years. I can't say I've felt that a PDF (regardless of how complex) has been slow during that time.
If I had an older computer, and my field of work required me to open extremely complex PDFs and my two options were 1) buying a $60 software 2) dropping $5K in a new computer... I think I'd chose the first.
Three seconds can get to be a real pain if you do it a lot.
Always room for things to go faster.
And as far as my hardware is concerned, not everyone has the latest hardware. But even old hardware is so incomprehensibly fast, there is no reason it shouldn't render everything at least at 60 FPS or higher.
If you don't struggle with slow PDFs, that's great; Pryzmera is probably not for you, but in architecture and related fields this is a huge problem.
I wish you good luck finding customers.
PDF X-Change comes to mind. It handles the linked stress PDF pretty well.
EDIT: I wonder if OP is an handmade hero guy? There's been a bunch of pretty cool products from that community: Zeiger, Blick, FilePilot, ...
Sample Link (West Mt. Rainier 7.5min): https://prd-tnm.s3.amazonaws.com/StagedProducts/Maps/USTopo/...
Perhaps then you should market it as "Fast PDF for people who love CAD" or something. Then you might catch the attention of the people for whom this solves a problem
Aiming generally at everyone, certainly I'm like "meh, PDF seems fast enough".
If you market to everyone, you market to no one.
Perhaps discuss the marketing and target market and segmentation of this product with your local LLM.
You have described to me a pain point for the construction and design industry that presumably has at least some money to spend on better tools.
I hope it can serve others as well!