# A 1998 PDF-to-Text Converter

DevFeed: [A 1998 PDF-to-Text Converter](<https://devfeed.tech/articles/a-1998-pdf-to-text-converter-84490.md>)

Original publisher: [Read original article](<https://code.dblock.org/2026/10/09/a-1998-pdf-to-text-converter.html>)

Author: Daniel Doubrovkine (dblock@dblock.org)

Published: 2026-10-09T00:00:00Z

Content type: article

Language: en

Sources: [Daniel Doubrovkine](<https://devfeed.tech/sources/daniel-doubrovkine.md>)

Topics: [Parser](<https://devfeed.tech/topics/parser.md>), [plist](<https://devfeed.tech/topics/plist.md>), [ClojureScript](<https://devfeed.tech/topics/clojurescript.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [GitHub Copilot CLI](<https://devfeed.tech/topics/github-copilot-cli.md>), [xz](<https://devfeed.tech/topics/xz.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [commands](<https://devfeed.tech/tags/commands.md>), [github-copilot-cli](<https://devfeed.tech/tags/github-copilot-cli.md>), [hash-table](<https://devfeed.tech/tags/hash-table.md>), [nostalgia](<https://devfeed.tech/tags/nostalgia.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [parsing](<https://devfeed.tech/tags/parsing.md>), [zlib](<https://devfeed.tech/tags/zlib.md>)

## AI overview

The author recovered a 1998 C++ PDF parser written for a search engine and ported it to C++17 with help from GitHub Copilot CLI. The parser handles PDF versions 1.0 through 1.2 by following cross-reference offsets and object references, and the updated port fixes several stream and text-handling issues while retaining the original version limits.

## Source excerpt

In 1998 I needed to convert PDF files to text for a search engine called Alkaline, without requiring separately installed libraries. So I wrote a C++ parser. Alkaline is another story. I recovered the source from a backup dated December 26, 1998. It reads PDF 1.0 through 1.2, follows object references and page trees, decompresses content with bundled zlib, and prints metadata, page text and bookmark titles. There are my own string, vector and hash-table libraries in there too. The encryption code is a stub. This was a work in progress. I wasn't reverse engineering an undocumented format. Adobe had published the specification in 1993, and my comments refer to the PDF Reference, right down to a page number for stream filters. This predates tagged PDF, introduced in 2001. Getting text meant interpreting page drawing commands, not following a tagged reading order. I was very impressed by how clever the format was. You start near the end, find the cross-reference table, and use its byte offsets to jump straight to the objects you need. A page points to its content and resources, so the reader follows those references rather than parsing the whole file from beginning to end. You don't have to read the entire document to render one page. GitHub Copilot CLI and I made it build again as a C++17 port, keeping the parsing approach but replacing the old containers with the standard library and using system zlib. The original is preserved unchanged. The port fixes binary stream lengths, line endings and several text operators, but it still targets those old PDF versions. Don't point it at a modern PDF and expect miracles. The source and port are on GitHub, under the MIT license. A 1998 PDF-to-Text Converter was originally published by Daniel Doubrovkine at code.dblock.org | tech blog on October 09, 2026.