meta data for this page
  •  

批次 Word 文件轉 PDF

想把多個 Word 文件一次轉 PDF 最好還順便合併起來,變成類似一本電子書,比較好閱讀,不用一個個點開和切換……

用 macOS Finder QuickLook 也是可以有類似的效果,但看到的 Word 檔不是實際的印刷樣式,比較像純文字,沒那麼美觀。

  1. Batch Convert Word Docs to PDF - Apple Community ⚠️ 好像只能處理 ASCII 檔名?漢字檔名不行的樣子(AppleScript 錯誤代碼 -212)
    1. 把檔名全部改為數字,結果還是一樣
  2. macos - Convert batch of Word files to PDFs in Mac OS X - Super User 這裡面提到一個叫 docx2pdf 的工具,要用 pip 安裝
    1. 我的 Mojave 暫時沒有 pip
      $ sudo easy_install pip
    2.    gjrobert   ~ 
       curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py                                            1 ↵  14:29:26 
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100 1892k  100 1892k    0     0  1535k      0  0:00:01  0:00:01 --:--:-- 1537k
         gjrobert   ~ 
       python get-pip.py                                                                                      14:41:32 
      ERROR: This script does not work on Python 2.7 The minimum supported Python version is 3.6. Please use https://bootstrap.pypa.io/pip/2.7/get-pip.py instead.
         gjrobert   ~ 
       curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py                                    1 ↵  14:41:52 
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100 1863k  100 1863k    0     0  1274k      0  0:00:01  0:00:01 --:--:-- 1273k
         gjrobert   ~ 
       python get-pip.py                                                                                      14:42:36 
      DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
      Defaulting to user installation because normal site-packages is not writeable
      Collecting pip<21.0
        Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
           |████████████████████████████████| 1.5 MB 1.1 MB/s
      Collecting wheel
        Downloading wheel-0.36.2-py2.py3-none-any.whl (35 kB)
      Installing collected packages: pip, wheel
        WARNING: The scripts pip, pip2 and pip2.7 are installed in '/Users/gjrobert/Library/Python/2.7/bin' which is not on PATH.
        Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
        WARNING: The script wheel is installed in '/Users/gjrobert/Library/Python/2.7/bin' which is not on PATH.
        Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
      Successfully installed pip-20.3.4 wheel-0.36.2

      反正大致是說我沒有 Python 3.6,所以需要另外下載 Python 2.7 的 get-pip.py → 下載 ✅ 執行 ✅ → 獲得 PIP

  3. 要用 pip 安裝 docx2pdf 時還是說找不到 pip↓
    $ brew unlink python && brew link python

    ❎ 還是不行

    1. $ sudo -H python -m ensurepip
      → 裝上了 pip-6.1.1
    2. 再裝 docx2pdf 還是不行啊 :(
      DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
      Defaulting to user installation because normal site-packages is not writeable
      ERROR: Could not find a version that satisfies the requirement docx2pdf (from versions: none)
      ERROR: No matching distribution found for docx2pdf
  4. 先放棄(爆):s
  5. 結果最後最簡單的方法:Adobe Acrobat「建立 PDF」→「多個文件」合併,還可以按原始的 Word 檔名建立目錄……

討論區

輸入您的意見. 允許使用維基語法:
P I N F E