Skip to main content

Download PDFs from ePapyrus StreamDocs viewers

Project description

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]]
Option Default Description
-o auto Output PDF path
-z 300 Zoom level (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)

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 auto-detection

The invisible text layer needs a Korean-capable font for search/copy. The tool tries:

  1. NanumGothic from common system paths
  2. fc-match :lang=ko (Linux with fontconfig)
  3. Fallback to reportlab built-in CID font (HYSMyeongJo-Medium)

To use a specific font: --font /path/to/font.ttf

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamdoc_dl-0.2.1.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamdoc_dl-0.2.1-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file streamdoc_dl-0.2.1.tar.gz.

File metadata

  • Download URL: streamdoc_dl-0.2.1.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for streamdoc_dl-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d4150f411fcbb38c6e4208a3621f533ce75aed07dc727f3581786b5e8c52ee89
MD5 3fd58d02d3bcc286ac72b0f02cc598cd
BLAKE2b-256 19c2fa7dec3c47cfd7cbe78fbb8d73184f532dee7620b245c4974fc6e3ae0b40

See more details on using hashes here.

File details

Details for the file streamdoc_dl-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: streamdoc_dl-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for streamdoc_dl-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a3ac447a45f89470325d67ed5d91f7d1cff8c544336b8856d4aa9b12b0f939cb
MD5 a769acfd82e2deebee47dc6f1b3cc0f7
BLAKE2b-256 67a39e59993feeb101a82e5c145106b1edfd6626d982cbd918aef4a6b58c9f67

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page