Skip to main content

streamdoc-dl

Slop coded. PRs welcome.

Download PDFs from ePapyrus StreamDocs viewers.

StreamDocs is an HTML5 document viewer by ePapyrus used on Korean government sites (standard.go.kr, e-book.scourt.go.kr, etc.) that renders PDFs as page images in-browser with download disabled. This tool reconstructs the PDF by downloading page images and text data, producing a searchable PDF with selectable text.

Install

pip install streamdoc-dl

Usage

streamdoc-dl 'https://www.standard.go.kr/streamdocs/view/sd;streamdocsId=1234567890'

Output filename is auto-detected from the server metadata.

Options

streamdoc-dl URL [-o OUTPUT] [-z ZOOM] [-j JOBS] [--font FONT] [--compress [LEVEL]] [--tor]
Option Default Description
-o auto Output PDF path
-z max Zoom level: max for highest quality, or a number (100=native, 200=2x, 300=3x)
-j 4 Concurrent download threads
--font auto Path to TTF font for text layer
--compress off Compress with Ghostscript (screen/ebook/printer/prepress)
--tor off Route traffic through Tor (SOCKS5 proxy on 127.0.0.1:9050)
--no-strip-watermark off Keep watermark characters in the text layer

Compression

Use --compress to reduce output size via Ghostscript (gs must be installed):

streamdoc-dl URL --compress          # default: ebook quality
streamdoc-dl URL --compress printer  # higher quality

Font Requirements

Important: A Korean-capable font is required for the text layer to work properly.

The tool tries to auto-detect in this order:

  1. NanumGothic from common system paths
  2. fc-match :lang=ko (Linux with fontconfig)
  3. Fallback to reportlab built-in CID font (may not work on all platforms)

Installation:

  • Arch/Manjaro: sudo pacman -S noto-fonts-cjk
  • Debian/Ubuntu: sudo apt install fonts-noto-cjk
  • Termux (Android): pkg install noto-fonts-cjk
  • macOS: brew install font-noto-sans-cjk
  • Windows: Download from Google Fonts

Or specify manually: --font /path/to/font.ttf

Tor

Use --tor to route all traffic through Tor (must be running on port 9050):

tor &
streamdoc-dl URL --tor

Resume

Interrupted downloads are automatically resumed. Page images and text are cached as they download. Re-run the same command to continue from where it left off. The cache is cleaned up after the PDF is built.

Cache location:

  • Linux: $XDG_CACHE_HOME/streamdoc-dl/ or ~/.cache/streamdoc-dl/
  • macOS: ~/Library/Caches/streamdoc-dl/
  • Windows: %LOCALAPPDATA%\streamdoc-dl\

How it works

  1. Fetches document metadata from the StreamDocs v4 API
  2. If the server allows direct download, fetches the original PDF
  3. Otherwise, downloads page images and text data concurrently
  4. Fixes the corrupted first byte on each image (server-side anti-scrape)
  5. Builds a PDF with image backgrounds and invisible text overlay

License

GPL-3.0-or-later

Metadata

Release files for streamdoc-dl 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamdoc-dl 0.2.4
File Size Uploaded Provenance Actions
streamdoc_dl-0.2.4.tar.gz 19.5 kB Without provenance Details for streamdoc_dl-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for streamdoc-dl 0.2.4
File Interpreter ABI Platform Actions
streamdoc_dl-0.2.4-py3-none-any.whl Python 3 none any Details for streamdoc_dl-0.2.4-py3-none-any.whl

Total release size: 39.5 kB

Release files / streamdoc_dl-0.2.4.tar.gz

Download URL streamdoc_dl-0.2.4.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
90ed82988001a209c532aad6ad36f44efd3de5119c55395835420a1f665c9fbb
BLAKE2b-256 checksum
How to use checksums
7aed78964ec8e049cd32e73356472458216a22e4a3b4be0fba035935bcc358fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / streamdoc_dl-0.2.4-py3-none-any.whl

Download URL streamdoc_dl-0.2.4-py3-none-any.whl
Size 19.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5bf8902859be7ab007f0e2ff05268ce71c901714014498ce1b3a453516a8967f
BLAKE2b-256 checksum
How to use checksums
ad7868a75b082151b071c8a44fbbcf2d13661792b257806d29fa474ca8081dbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Security for streamdoc-dl 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page