Prepare an archive index
Use the OCR words distributed with a book on the Internet Archive to search the matching PDF in Folio Find. For the Calahan example, the reader guide includes a ready-made index.
Convert a book
Extract the Folio Find offline ZIP. Run these commands from the extracted reader folder using Python 3.10 or later. Use the filename of your local PDF and the identifier after /details/ in the book’s archive URL.
python -m pip install -r tools/requirements-archive.txt
python tools/archive_index.py "CatalogOfSpecialGoodsForPlumbersJHCalahan.pdf" --item CatalogOfSpecialGoodsForPlumbersJHCalahan
Only the item identifier goes into the metadata request. The converter downloads the matching XML, checks the local PDF and XML against the file listing, compares each page’s dimensions, then creates a new .archive.folio.jsonl beside your PDF. Use -o FILE to choose another output name.
Convert offline
With the dependencies installed, save the item’s JSON response from https://archive.org/metadata/IDENTIFIER and its _djvu.xml file alongside your PDF. The following command uses only local files.
python tools/archive_index.py book.pdf --metadata metadata.json --xml book_djvu.xml
Search
Open the same PDF in Folio Find. Choose Search index → Load index and select the converted file. Search a word, select its result, and inspect the print. The index contains readable OCR text and its page locations. A renamed copy of the same PDF works.
Each PDF page must correspond to one XML page, and their displayed aspect ratios must agree within 2%. Cropped editions and different scans can have different page coordinates. The converter reports skipped word boxes and rejects mismatched files. Check a few highlights on the page when using a new edition. In one railway timetable, a box covered only the last digit of a sideways number. Inspect the page detail.