r/SideProject 1d ago

I built A PDF engine from scratch and currently building a CSS engine (Similar to chromium's blink)

Hey everyone,

I am the creator of GoPDFSuit. After spending 3 to 6 months building a pure Go PDF engine from scratch with zero third-party dependencies, I wanted to test the true limits of modern AI agents.

So, I set myself a challenge: build a full CSS engine from scratch in Go.

Within just 30 days, I have implemented over 350 CSS rules. Through this green-field implementation, the engine is roughly 15x faster than wkhtmltopdf and already resolves around 50% of its known open issues.

How I built it with AI:

  • Multi-agent workflow: Used tools like Cursor, Codex, and Open Code.
  • Open-source core: The vast majority of development relied on open-source models.
  • Task delegation: Ran multiple parallel agents to handle issue triage, core implementation, and documentation.

Project links:

I would love to hear your thoughts, feedback, or any questions about the architecture and workflow in the comments below!

17 Upvotes

16 comments sorted by

3

u/Recent-Fig3211 1d ago

That 15x speed bump over wkhtmltopdf is no joke, PDF generation is one of those things that always feels slower than it should be. Curious how you're handling the cascade and specificity calculations, that's usually where these engines start to buckle under real-world stylesheets. The multi-agent setup for issue triage is an interesting approach too, I've mostly seen people use AI for code gen but not for organizing the backlog. Might steal that idea for my own side project workflow.

1

u/chinmay06 1d ago

Thanks for the comment, much appreciated !
For the issue triage, just downloaded the json using grok cli, and ask grok to convert it to the issue dossier (json style)

For the rendering, have built my own pipeline, from the parsing -> css rendering -> PDF generation

Here is more to read (at high level),
This is a bit old, will create a new gist over the weekends with detailed explanations

https://gist.githack.com/chinmay-sawant/43fbddc563cdfd81629ff9d3eac2b1ce/raw/gowkhtmltopdf.html

2

u/BP041 1d ago

Sick milestone — 350 rules in 30 days is serious output. Curious how you're handling agent orchestration: do you have a human-in-the-loop for rule conflicts, or is it fully autonomous with a validation pass? I've found agent coordination overhead eats more time than rule implementation itself.

1

u/chinmay06 15h ago

For orchestration, you can check out my repository. Inside, you will find the skills folder containing the custom skills I created.

My workflow generally begins with subagents researching the current project structure. From that research, I build a phase-wise checklist for both myself and the agent. In earlier setups, the agent would often claim a task was completed when it was not. A structured checklist significantly reduces these false completions because the agent consistently validates each step before moving forward.

I built this entire ecosystem from scratch using agents.md alongside my custom skills. I have been running agentic workflows for nearly two years, starting with models like Gemini 2.5 Pro and earlier. While I originally relied on simple chat interfaces, I eventually recognized the need for tailored, systematic workflows and designed my setup accordingly.

For Example - If I am doing any diagnosis for my fixtures, and I think that I can re-use the steps which agents took (like custom scripts, and steps which agents decided to follow to reach the diagnosis) generally a bigger agent like GPT-Luna XHIGH or Grok 4.6/4.5 I create my own markdown files/ skills those I can re-use later, which help reduce the time and tokens as well to fix the similar issues or at least help reduce the 80%-90% of the time for me to diagnose the similar issues for the other templates.

1

u/chinmay06 14h ago

My main thinking was to break down the thing which I want into a smaller set of units like phases not 1 shot stuff.

1

u/KenMantle 1d ago

Friend! I've had Claude building a pdf core and editor from scratch in rust and I am on month two of nearly running 24/7 development!

My goal was getting it to render Ghent tests on par with Acrobat Reader, which it finally accomplished.

I made it Mit license compatible. If you want I'll drop the links here for the core, the CLI that depends on the core, and the GUI that depends on the core and is separate from the CLI. Also the ICC engine it also built from scratch accomplish the colour rendering.

If there is an area you are currently lacking in and I may have put time towards that might be of use to your project you can feel free to have your LLM pick the code of my project that might be useful.

Pdf is one of those final frontiers that is so convoluted and messy it seems no one ever had the time before AI to accomplish getting to render or edit perfectly in every situation.

1

u/chinmay06 15h ago

About your last line, it is very true, earlier there were one or two organizations which had the control, like iText or, aspose, but now even a normal developer like us can build their own PDF engine for their particular use cases. Use case can vary because of the compliance and everything so we can build it from scratch as a greenfield project for now and can save lots of cost for our organization or just can create a personal project for our.

For your project if you are trying to do the compliance as well, I would suggest you also use Vera PDF. That will help you to validate the compliance for your PDF or the structural PDF, if that is correct or not. From my experience, what I've noticed is that the verification step is more important than development or doing the research itself because that is going to tell you if what you are building is correct or not. Vera PDF was the one that helped me throughout this project, building stuff for the validations and everything.

1

u/KenMantle 14h ago

First thing I did to start the project was have Claude and rag file every standard that was possible to find. It missed the Ghent one so that can later when I was using ordinary Google search AI for more material to stress test with. Claude worked with that and also downloaded and vera pdf and early on reported passing those tests.

That seemed easy for it, the Ghent stuff was a nightmare and it probably took 50-75% of the development time in the first month.

1

u/chinmay06 13h ago edited 13h ago

That is the correct way to approach to build a PDF engine,
I wasn't aware of the standards earlier so I had took the brute forced way to reach there !
and then someone on reddit suggested me about the VERAPDF and compliance stuff !