zoukankan      html  css  js  c++  java
  • 提取pdf文档表格

    import   pdfplumber

    pdf=pdfplumber.open(',,,,,,,.pdf')

    first_page=pdf.pages[0]

    print(first_page.extract_text())    #打印第一页内容

    #提取其中的表格

    first_page.extract_table()    #提取这一页的第一个表格

    first_page.extract_tables()     #提取这一页内的所有表格

    #提取表格时设置表格参数

    first_page.extract_table(

    table_settings={'

           vertical_strategy':'text',

           'horizontal_strategy':'text'

          }

            )

    if    not   ''.join(  [  str(i)   for  i in  first_page.extract_text( )   ]  )   == '' :    #这行不为空则继续执行以下操作

      ''.join( [ str(item)  if  item   else  ''  for  item  in    i[:3]  )

  • 相关阅读:
    java 基本功
    orale问题汇总
    redis 集群
    centos7 之 systemctl
    redis 常见问题记录
    docker问题汇总
    sql plus 导出建表语句
    linux 添加删除用户
    mysql常用配置
    SAS 查看临时数据集
  • 原文地址:https://www.cnblogs.com/energetic/p/13052600.html
Copyright © 2011-2022 走看看