Skip to main content

CLI tool to remove the NotebookLM mark from the bottom-right corner of each PDF page and export screenshots plus a cleaned PDF.

Project description

pdf-notebooklm-cleaner

PyPI version PyPI - Python Version PyPI - Downloads License

命令行工具:输入 PDF,输出两类结果:

  • 每页完整截图 ZIP
  • 去除右下角 NotebookLM 标识后的 clean PDF

适合这类场景:PDF 每页内容完整、边框要保留、右下角有 NotebookLM logo/文字,需要批量清理后导出整页截图。

安装

pip install pdf-notebooklm-cleaner

用法

pdf-notebooklm-cleaner input.pdf

指定输出目录:

pdf-notebooklm-cleaner input.pdf -o ./out

提高渲染清晰度:

pdf-notebooklm-cleaner input.pdf --dpi 300

输出结构

默认会在输入 PDF 同目录下生成:

<input_stem>_cleaned/
├── screenshots/
│   ├── page_01.png
│   ├── page_02.png
│   └── ...
├── <input_stem>_screenshots.zip
└── <input_stem>_clean.pdf

可调参数

  • --dpi:渲染分辨率
  • --search-width-ratio:右下角检测区域宽度比例
  • --search-height-ratio:右下角检测区域高度比例
  • --dark-threshold:检测暗色像素阈值
  • --bbox-pad-px:检测框外扩像素
  • --edge-margin-px:保留右/下边框的安全边距

工作原理

  1. 用 PyMuPDF 将每页渲染为高分辨率 PNG
  2. 在右下角区域自动检测 NotebookLM logo/文字位置
  3. 以周边背景色覆盖该区域,尽量保留边框
  4. 重新打包为截图 ZIP 和 clean PDF

局限

这个版本针对右下角 NotebookLM 标识的常见模板效果较好。若页面设计差异较大,建议优先调整:

  • --search-width-ratio
  • --search-height-ratio
  • --bbox-pad-px
  • --edge-margin-px

开发

python -m pip install -U build twine
python -m build
python -m twine check dist/*

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

pdf_notebooklm_cleaner-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

pdf_notebooklm_cleaner-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file pdf_notebooklm_cleaner-0.1.0.tar.gz.

File metadata

  • Download URL: pdf_notebooklm_cleaner-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pdf_notebooklm_cleaner-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5078af56661bfe1b8eb426ad360f16aa91d1bb7c3e2eb7c81c55707bebf187cd
MD5 1d2173b0910ace0d9631128ee4b6416d
BLAKE2b-256 c13a8b52c8f8b53289e083123918c40e587db6f4cd493cccb330cc7fa1454949

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdf_notebooklm_cleaner-0.1.0.tar.gz:

Publisher: publish.yml on gptbert/pdf-notebooklm-cleaner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pdf_notebooklm_cleaner-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pdf_notebooklm_cleaner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a233a44da2c39b051561712ffc0b981131718d177ec8db98edfda990886a67b5
MD5 f0e2daa5f4d3e5ac7a745628c0cb28d2
BLAKE2b-256 584fdb93d6185b9d0a88140162dcef1910d3aeda3f4caff38ee04b8f07f1cc92

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdf_notebooklm_cleaner-0.1.0-py3-none-any.whl:

Publisher: publish.yml on gptbert/pdf-notebooklm-cleaner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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