首页 > 解决方案 > 如何在 Python 中运行 PDFbookmarker

问题描述

我正在尝试使用此工具https://github.com/RussellLuo/pdfbookmarker但我经常收到错误消息。

我安装了便携式WinPython,通过pip安装了PyPDF2,下载了add_bookmarks.py脚本并将其粘贴到WinPython目录中,更改了它的执行权限,就是无法正常运行,为什么?

Python 3.5.4 (v3.5.4:3f56838, Aug  8 2017, 02:17:05) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> add_bookmarks.py <test.pdf> [sample_bookmarks.txt] [FILE-new.pdf]
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    add_bookmarks.py <test.pdf> [sample_bookmarks.txt] [FILE-new.pdf]
NameError: name 'add_bookmarks' is not defined
>>> 

标签: pythonpdfpypdf2

解决方案


最终我使用了另一个:https ://github.com/lstolcman/pdf_bookmarks并且它起作用了。


推荐阅读