V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
bestehen
V2EX  ›  Python

Python 中处理 pdf 问题

  •  
  •   bestehen · 2018-09-02 17:47:37 +08:00 · 1710 次点击
    这是一个创建于 2055 天前的主题,其中的信息可能已经有所发展或是发生改变。

    现在情况是这样,我在处理 pdf 文件的时候遇到了一个水印 对应读取的一个元素是 FormXob.86cdf15f1994e2f2b7032e461

    我现在想办法处理

    把得到的这个元素给排除掉放进新的 pdf 里面 如何解决呢?

    我用的是 Py2PDF

    读取的一页元素如下,里面包含了 Formxob {'/Parent': IndirectObject(1, 0), '/Contents': IndirectObject(22, 0), '/Tabs': '/S', '/Resources': {'/XObject': {'/Image5': IndirectObject(23, 0), '/FormXob.86cdf15f1994e2f2b7032e461afd4234': IndirectObject(25, 0)}, '/ExtGState': {'/Xi0': IndirectObject(26, 0), '/gRLs0': {'/ca': 0.13}}, '/Font': {'/F1renamed': {'/Encoding': '/WinAnsiEncoding', '/Type': '/Font', '/Name': '/F1', '/BaseFont': '/Helvetica', '/Subtype': '/Type1'}, '/F1': IndirectObject(27, 0), '/Xi2': IndirectObject(35, 0), '/Xi1': IndirectObject(38, 0)}, '/ProcSet': ['/Text', '/ImageC', '/ImageB', '/PDF', '/ImageI']}, '/Group': {'/Type': '/Group', '/S': '/Transparency', '/CS': '/DeviceRGB'}, '/MediaBox': [0, 0, 720, 405], '/Type': '/Page', '/StructParents': 0}

    请问现在如何解决呢?

    1 条回复    2018-09-04 17:52:35 +08:00
    jiangbingo
        1
    jiangbingo  
       2018-09-04 17:52:35 +08:00
    getpage 以及 mergePage,水印也是一页叠加的 page,可以看看是否有 deleltepage 的操作。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1297 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:40 · PVG 01:40 · LAX 10:40 · JFK 13:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.