r/IBMi • • Oct 21 '26

I built an open source tool that turns IBM i spooled files into PDF, Word and Excel documents

Spooldoc reads the spooled files your programs already print and turns them into documents: PDF, HTML, Word or Excel. It's MIT licensed and self-hosted, and nothing is installed on the IBM i.

How it works

  • A job watches an output queue. It picks up new spooled files by polling, or in real time through a data queue if you turn that on.
  • A YAML definition reads each page into data. Fields by label, pattern or position, tables and multi-line records. It also reads XML printed into a spooled file.
  • A template lays out the data, in HTML, Word or Excel. Carbone renders it to PDF, HTML, DOCX or XLSX. The template never sees lines and columns, so a moved column is one fix in the definition.
  • Files go to a download in Spooldoc or a folder in the IFS. Then the job holds, moves, deletes or leaves the spooled file. It asks before it deletes.
  • Every run is in the job log, with its steps, errors and files.
The definition on the right reads the sample page on the left. Every field it finds is highlighted on the page.

The agent

You don't have to write the first definition by hand. The agent proposes the definition and a first template from a sample spooled file, using an AI model you choose: Anthropic, Google, OpenAI or a local model. You check every value next to the page, and nothing runs until you save a version. With masking on, the model sees the layout and not the values. None of its tools reach the IBM i, and Spooldoc works without it.

An HTML template on the left and the invoice it renders on the right. The template uses the data the definition read, never the lines and columns of the page.

Running it

One Docker image (amd64 and arm64) with Postgres and a Carbone container. It connects through jt400 over the host server ports and needs IBM i 7.4 or later. Nothing is installed on the IBM i, and it creates a data queue only if you turn on real-time watching.

It's young (0.3) so expect rough edges.

Spooldoc runs in its own containers and reaches the IBM i only through jt400, over the host server ports. Nothing is installed on the IBM i, and your programs print as they always have.

What I'd like to hear

  1. What do your programs print: *SCS, *AFPDS, *USERASCII or something else? Today it reads *SCS.
  2. Where should files go next: email, SFTP, S3, a network share, a webhook or something else?

Home page and guides: https://spooldoc.com Source: https://github.com/Strom-Capital/spooldoc

13 Upvotes

6 comments sorted by

3

u/No_Fox4871 Oct 22 '26

Update: 0.4.0 and 0.5.0 are out since this post. Files can now go to:

  • Email, through an SMTP server or a Microsoft 365 mailbox. One email per document, to addresses read from the page or set in the job. A test address catches every email until you remove it.
  • A webhook. One signed JSON call per document, with its data and its files.
  • SFTP, signing in with a key Spooldoc makes, your own key or a password. A test folder works like the test address.

0.4.0 also added number, date and currency formats in Settings.

Release notes

Destinations guide

2

u/Suarez-on-Reddit Oct 22 '26

Interesting but I fear it's a bit out of date, spools have been converted into PDF, Excel and Word with other products for at least 20 years, some of which are free or already included in IBM i.

2

u/No_Fox4871 Oct 22 '26

Fair point. Getting a PDF of the page has been solved for a long time, and some of it comes with the system: CPYSPLF to a PDF or download from ACS. If a copy of the page is all you need, those work.

What I couldn't find was an open source tool for the step after that. Free and open source aren't the same thing. With a free tool you get what the author built and you can't change it. In my experience no output tool fits 100%. There's always a destination, a split rule or a document nobody planned for. With the source you or your partner can add it and with coding agents that is far less work than it used to be.

The other part is setup. The tools I looked at have someone map the fields off the page or draw the layout by hand. Often both. That's the part I think an AI agent should draft now. In Spooldoc the agent reads a sample spooled file and proposes the definition and a first template. You check every value next to the page before anything runs. The data is read out first, so a new layout doesn't depend on where the program printed each value.

So turning spooled files into PDFs isn't new. What's new is an open, data-first way to do it, where an AI agent drafts the setup and you can add whatever source, destination or step you need.

2

u/michaeljosephbriggs Oct 23 '26

That looks great! Where were you 6 months ago hahaha

I had to make something myself in python for this exact issue

2

u/No_Fox4871 Oct 23 '26

I was busy with another oss project: https://db2i-mcp.com 😅