Skip to main content

Just a simple command-line tool for converting PDF files into images, with support for multiprocessing to enhance performance.

Project description

PDFize

python-version License

Brief

Just a simple command-line tool for converting PDF files into images, with support for multiprocessing to enhance performance.

pdfize

Installation

pip install pdfize

Third Party Library

  1. PyMuPDF : AGPL 3.0
  2. Pillow : HPND
  3. click : BSD
  4. tqdm : MIT, MPL 2.0
  5. click-help-colors : MIT

Help

  • general options

    • --pbar/--no-pbar : 開啟命令行進度條 (flag)

    • -s | --style : 進度條樣式

      ASCII_GRADIENT :  ░▒▓█
      ASCII_PIXEL    :  ▖▘▝▗▚▞█
      ASCII_SQUARE   :  ▨■
      ASCII_CIRCLE   :  ○◐⬤
      ASCII_SPEED    :  ▱▰
      ASCII_DOT      :  ⣀⣦⣿
      ASCII_BOX      :  ▯▮
      
  • command

    • img-to-pdf : image 轉 PDF

      • -o | --output : 指定 pdf 檔案名稱
        pdfize img-to-pdf "input.jpeg" -o "output.pdf"
        pdfize img-to-pdf "images_dir/" -o "output.pdf"
        
    • pdf-to-img : PDF 轉 image

      • -d | --dpi : 指定 image 解析度 (預設: 100)

        pdfize pdf-to-img "input.pdf" -o "output/" -d 400
        
      • -f | --format : 指定 image 格式 (預設: png)

        pdfize pdf-to-img "input.pdf" -o "imgdir/" -f "webp"
        
      • -n | --name : 指定 image 主名稱 (預設: 同輸入 pdf 名稱)

        pdfize pdf-to-img "input.pdf" -o "imgdir/" -n "output"
        
      • -o | --output : 指定 image 目錄名稱

        pdfize pdf-to-img "input.pdf" -o "imgdir/"
        
      • --parallel : 開啟多進程平行執行 (flag)

        pdfize pdf-to-img "input.pdf" -o "imgdir/" --parallel
        
      • --subdir : 有多個 pdf 時,以原 pdf 名稱作為子目錄 (flag)

        pdfize pdf-to-img "pdfs_dir/" -o "result/" --subdir
        
      • -w | --worker : 若有開啟多進程平行執行,選擇使用幾顆 cores 加速

        開很多 process 速度加倍,但會吃非常多記憶體

        pdfize pdf-to-img "pdfs_dir/" -o "result/" --parallel -w 4 
        
    • split : PDF 拆分

      • -o | --output : 輸出 pdf 檔案

        pdfize split "input.pdf" -r 2 5 -o "output.pdf"
        
      • -r | --range : 頁數範圍

        支援負數索引 (如 -1 代表最後一頁)。若 from 頁數比 to 頁數後面,表示倒序。

        pdfize split "input.pdf" -r 2 5 -o "output.pdf"
        pdfize split "input.pdf" -r 2 -1 -o "output.pdf"
        pdfize split "input.pdf" -r 5 2 -o "output.pdf"
        pdfize split "input.pdf" -r -2 2 -o "output.pdf"
        
    • merge : PDF 合併

      • -o | --output : 輸出檔案
        pdfize merge "pdfs_dir/" -o "output.pdf"
        

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

pdfize-0.3.5.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

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

pdfize-0.3.5-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file pdfize-0.3.5.tar.gz.

File metadata

  • Download URL: pdfize-0.3.5.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.5

File hashes

Hashes for pdfize-0.3.5.tar.gz
Algorithm Hash digest
SHA256 650170620098097fcc44781208f68efa207585648a2376edaf5c11910d1ecff4
MD5 e92c826190fbb48567298b676f170d1d
BLAKE2b-256 cc0d004f190d5bfc6b481993bb75a7c126e61cb2503e967929bfeca486dfc5cd

See more details on using hashes here.

File details

Details for the file pdfize-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: pdfize-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.5

File hashes

Hashes for pdfize-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 12ce62f12a1093b865cdfe35cde52987029473b93265ef3d08296a0200c34059
MD5 7da33d7e687dc97020dcbbd6cffe3808
BLAKE2b-256 c6f836ae0478eeeefe8fb984d3683e2be9eb749d645e7c6363faafc351b03e0c

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