{"id":261,"date":"2021-08-21T12:00:48","date_gmt":"2021-08-21T04:00:48","guid":{"rendered":"https:\/\/www.cygzs.net\/?p=261"},"modified":"2021-08-21T12:05:06","modified_gmt":"2021-08-21T04:05:06","slug":"python%e8%af%bb%e5%8f%96pdf%e5%8f%91%e7%a5%a8%e4%bf%a1%e6%81%af","status":"publish","type":"post","link":"https:\/\/www.cygzs.net\/?p=261","title":{"rendered":"Python\u8bfb\u53d6PDF\u53d1\u7968\u4fe1\u606f"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u8bfb\u53d6\u65b9\u6cd5\uff1a\u91c7\u7528PDF\u8f6cDOCX\uff0c\u89e3\u538bDOCX\u4f7f\u7528xml\u8bfb\u53d6word\/document.xml\u6587\u5b57\uff0c\u83b7\u53d6\u51fa\u6240\u6709\u6587\u5b57\u7c7bw:t\u8282\u70b9nodeValue\u503c\uff0cre\u8fc7\u6ee4\u51fa\u53d1\u7968\u5185\u5bb9\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Github \u5730\u5740:\uff1a<a href=\"https:\/\/github.com\/hefaxing\/fapiao_read\">https:\/\/github.com\/hefaxing\/fapiao_read<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ed4\u7ec6\u770bconfig.ini\uff0c\u4fee\u6539\u76f8\u5e94\u4fe1\u606f\uff0c\u6d4b\u8bd5\u8fd0\u884c\u51e0\u6b21\u5c31\u61c2\u4e86\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5404\u4e2a\u65b9\u6cd5\u4ee3\u7801\u5c55\u793a\uff08\u8bf7\u52ff\u76f4\u63a5\u590d\u5236\u8fd0\u884c\uff0c\u6ca1\u6709\u4e3b\u4f53\u8c03\u7528\uff0c\u8bf7\u79fb\u6b65Github\u4e0b\u8f7d\u5b8c\u6574\u4ee3\u7801\uff09\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><pre class=\"wp-block-code\"><code>#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\n# author: CY\n# Date: 2021-08-19\n# QQ: 77061066\n# Version: 1.0.210820.1700\n#\n# pip install pdf2docx==0.5.2\n# pip install pyzbar==0.1.8\n# pip install pandas==1.3.0\n# pip install Pillow==8.3.1\n# pip install frontend==0.0.3\n# pip install openpyxl==3.0.7\n#\n# \u83b7\u53d6PDF\u53d1\u7968\u4fe1\u606f\n# \u76f8\u5e94\u914d\u7f6e\u67e5\u770bconfig.ini\uff0c\u4fdd\u8bc1config.ini\u8ddf\u811a\u672c\u5728\u540c\u4e00\u76ee\u5f55\n# \u8bfb\u53d6\u65b9\u6cd5\uff1a\u91c7\u7528PDF\u8f6cDOCX\uff0c\u89e3\u538bDOCX\u4f7f\u7528xml\u8bfb\u53d6word\/document.xml\u6587\u5b57\uff0c\u83b7\u53d6\u51fa\u6240\u6709\u6587\u5b57\u7c7bw:t\u8282\u70b9nodeValue\u503c\uff0cre\u8fc7\u6ee4\u51fa\u53d1\u7968\u5185\u5bb9\u3002\n\nimport os\nimport ast\nimport re\nimport configparser\nimport fitz\nimport shutil\nimport pandas\nfrom pdf2docx import Converter\nfrom zipfile import ZipFile\nfrom xml.dom.minidom import parseString\nfrom PIL import Image\nfrom pyzbar.pyzbar import decode\n\ndef Get_files(path, suffix):\n    # \u83b7\u53d6\u76ee\u5f55\u4e0b\u6240\u6709\u5339\u914d\u6269\u5c55\u540d\u7684\u6587\u4ef6\n    # path : str ('C:\\\\Windows\\\\Temp')\n    # suffix : str ('pdf')\n    #\n    #pdf_files = [os.path.join(root, file_name) for root, subdirs, file_names in os.walk(path) for file_name in file_names if file_name.endswith('.%s' % suffix)]\n\n    pdf_files = []\n    for root, subdirs, file_names in os.walk(path):\n        for file_name in file_names:\n            if file_name.endswith('.%s' % suffix):\n                file_path = os.path.join(root, file_name)\n                pdf_files.append(file_path)\n\n    return pdf_files\n\ndef Filter_str(filter_str):\n    # \u8fc7\u6ee4\u4e0d\u5fc5\u8981\u7684\u5b57\u7b26\n    # filter_str : str ('\u91c7\u7528PDF\u8f6cDOCX\uff0c\u89e3\u538bDOCX\u4f7f\u7528xml\u8bfb\u53d6word\/document.xml\u6587\u5b57\uff0c\u83b7\u53d6\u51fa\u6240\u6709\u6587\u5b57\u7c7bw:t\u8282\u70b9nodeValue\u503c\uff0cre\u8fc7\u6ee4\u51fa\u53d1\u7968\u5185\u5bb9\u3002')\n\n    filter_str = filter_str.replace(' ', '')\n    filter_str = filter_str.replace('\u3000', '')\n    filter_str = filter_str.replace(':', '')\n    filter_str = filter_str.replace('\uff1a', '')\n    filter_str = filter_str.replace('\uffe5', '')\n    filter_str = filter_str.replace('\u00a5', '')\n    filter_str = filter_str.replace('\uff08', '(')\n    filter_str = filter_str.replace('\uff09', ')')\n    return filter_str\n\ndef Read_QR_code(img_file):\n    # \u8bfb\u53d6\u56fe\u7247\u4e2d\u7684\u4e8c\u7ef4\u7801\u4fe1\u606f\n    # img_file : str ('C:\\\\Windows\\\\Temp\\\\temp.png')\n\n    qr_code = {'qr_code_code': '', 'qr_code_number': '', 'qr_code_total': '', 'qr_code_date': '', 'qr_code_check_code': ''}\n    img = Image.open(img_file)\n    barcodes = decode(img)\n    if barcodes is not None:\n        qr_code_data = barcodes[0].data.decode(\"utf-8\")\n        qr_code_date = qr_code_data.split(',')\n        qr_code['qr_code_code'] = qr_code_date[2]\n        qr_code['qr_code_number'] = qr_code_date[3]\n        qr_code['qr_code_total'] = qr_code_date[4]\n        qr_code['qr_code_date'] = qr_code_date[5]\n        qr_code['qr_code_check_code'] = qr_code_date[6]\n    return qr_code\n\ndef From_pdf_to_png(pdf_file, temp_png_file):\n    # pdf\u8f6cpng\n    # pdf_file : str ('C:\\\\Windows\\\\Temp\\\\temp.pdf')\n    # temp_png_file : str ('C:\\\\Windows\\\\Temp\\\\temp.png')\n\n    doc = fitz.open(pdf_file)\n    page = doc.loadPage(0)\n    trans = fitz.Matrix(2, 2)\n    pix = page.getPixmap(matrix=trans, alpha=False)\n    pix.writePNG(temp_png_file)\n    doc.close()\n    return temp_png_file\n\ndef From_pdf_to_docx(pdf_file, docx_file):\n    # pdf\u8f6cdocx\n    # pdf_file : str ('C:\\\\Windows\\\\Temp\\\\temp.pdf')\n    # docx_file : str ('C:\\\\Windows\\\\Temp\\\\temp.docx')\n\n    cv = Converter(pdf_file)\n\n    # \u9ed8\u8ba4\u53c2\u6570start=0, end=None\u8868\u793a\u8f6c\u6362\u6240\u6709\u9875\u9762\n    cv.convert(docx_file)\n    cv.close()\n    return docx_file\n\ndef Read_docx(docx_file):\n    # \u89e3\u538bdocx\u6587\u6863\n    # docx_file : str ('C:\\\\Windows\\\\Temp\\\\temp.docx')\n\n    zf = ZipFile(docx_file)\n    # \u67e5\u770b\u6240\u6709\u6587\u4ef6\u540d\u5b57\n    #for item in zf.filelist:\n    #    print(item.filename)\n\n    # \u8bfb\u53d6word\/document.xml\u5185\u5bb9\n    myfile = zf.open('word\/document.xml')\n    xml_str = myfile.read()\n    zf.close()\n\n    #collection = DOMTree.documentElement\n    #print('collection\u5c5e\u6027',collection.nodeName,collection.nodeValue,collection.nodeType)\n    \n    # \u89e3\u6790xml\u5185\u5bb9\n    DOMTree = parseString(xml_str)\n    collection = DOMTree.documentElement\n    \n    # \u83b7\u53d6\u6240\u6709'w:t'\u8282\u70b9\n    w_t = collection.getElementsByTagName('w:t')\n    node_text = []\n    for w_t_node in w_t:\n        for node in w_t_node.childNodes:\n            node_text.append(Filter_str(node.nodeValue))\n    \n    #print(node_text)\n    return node_text\n\ndef Get_fapiao_info(text_info):\n    # \u5339\u914d\u53d1\u7968\u4fe1\u606f\n    # text_info : list (['\u53d1\u7968\u4ee3\u7801', '888888888888', '\u53d1\u7968\u53f7\u7801', '88888888', ...])\n\n    text_info = ''.join(text_info)\n    text_info2 = text_info.split('\u5bc6\u7801\u533a')[-1]\n    #print(text_info)\n\n    # \u6b64re\u5339\u914d\u62a5\u9519\uff0c\u4fee\u6539\u5339\u914d\u89c4\u5219\uff0c\u6216\u5982\u4e0d\u5fc5\u8981\uff0c\u53ef\u6ce8\u91ca\u5bf9\u5e94\u884c\n    fapiao_info = {}\n    fapiao_info['fapiao_code'] = re.findall(\"\u53d1\u7968\u4ee3\u7801(\\d+)\", text_info)[0]\n    fapiao_info['fapiao_number'] = re.findall(\"\u53d1\u7968\u53f7\u7801(\\d+)\", text_info)[0]\n    fapiao_info['fapiao_date'] = re.findall(\"\u5f00\u7968\u65e5\u671f(.*?)\u6821\u9a8c\u7801\", text_info)[0]\n    fapiao_info['fapiao_check_code'] = re.findall(\"\u6821\u9a8c\u7801(\\d+)\", text_info)[0]\n    fapiao_info['fapiao_buyer_name'] = re.findall(\"\u8d2d\u4e70\u65b9\u540d\u79f0(.*?)\u7eb3\u7a0e\u4eba\u8bc6\u522b\u53f7\", text_info)[0]\n    fapiao_info['fapiao_buyer_tax_number'] = re.findall(\"\u8d2d\u4e70\u65b9\u540d\u79f0.*?\u7eb3\u7a0e\u4eba\u8bc6\u522b\u53f7(.*?)\u5730\u5740\", text_info)[0]\n    fapiao_info['fapiao_goods'] = re.findall(\"\u670d\u52a1\u540d\u79f0(.*?)\u5408\u8ba1\u89c4\u683c\u578b\u53f7\", text_info)[0]\n    fapiao_info['fapiao_s_tax_total'] = re.findall(\"\\(\u5927\u5199\\)(.*?)\\(\u5c0f\u5199\\)\", text_info)[0]\n    fapiao_info['fapiao_tax_total'] = re.findall(\"\\(\u5c0f\u5199\\)(\\d+.\\d+)\", text_info)[0]\n    fapiao_info['fapiao_seller_name'] = re.findall(\"\u9500\u552e\u65b9\u540d\u79f0(.*?)\u7eb3\u7a0e\u4eba\u8bc6\u522b\u53f7\", text_info2)[0]\n    fapiao_info['fapiao_seller_tax_number'] = re.findall(\"\u9500\u552e\u65b9\u540d\u79f0.*?\u7eb3\u7a0e\u4eba\u8bc6\u522b\u53f7(.*?)\u5730\u5740\", text_info2)[0]\n    fapiao_info['fapiao_address_phone'] = re.findall(\"\u7535\u8bdd(.*?)\u5f00\u6237\u884c\", text_info2)[0]\n    fapiao_info['fapiao_bank_name'] = re.findall(\"\u5f00\u6237\u884c\u53ca\u8d26\u53f7(.*?)\u5907\u6ce8\", text_info2)[0]\n\n    #print('\u53d1\u7968\u4ee3\u7801 %s' % fapiao_info['fapiao_code'])\n    #print('\u53d1\u7968\u53f7\u7801 %s' % fapiao_info['fapiao_number'])\n    #print('\u5f00\u7968\u65e5\u671f %s' % fapiao_info['fapiao_date'])\n    #print('\u6821\u9a8c\u7801 %s' % fapiao_info['fapiao_check_code'])\n    #print('\u8d2d\u4e70\u65b9\u540d\u79f0 %s' % fapiao_info['fapiao_buyer_name'])\n    #print('\u8d2d\u4e70\u65b9\u7eb3\u7a0e\u4eba\u8bc6\u522b\u53f7 %s' % fapiao_info['fapiao_buyer_tax_number'])\n    #print('\u670d\u52a1\u540d\u79f0 %s' % fapiao_info['fapiao_goods'])\n    #print('\u4ef7\u7a0e\u5408\u8ba1\uff08\u5927\u5199\uff09 %s' % fapiao_info['fapiao_tax_total'])\n    #print('\u4ef7\u7a0e\u5408\u8ba1\uff08\u5c0f\u5199\uff09 %s' % fapiao_info['fapiao_tax_total'])\n    #print('\u9500\u552e\u65b9\u540d\u79f0 %s' % fapiao_info['fapiao_seller_name'])\n    #print('\u9500\u552e\u65b9\u7eb3\u7a0e\u4eba\u8bc6\u522b\u53f7 %s' % fapiao_info['fapiao_seller_tax_number'])\n    #print('\u5730\u5740\u3001\u7535\u8bdd %s' % fapiao_info['fapiao_address_phone'])\n    #print('\u5f00\u6237\u884c\u53ca\u8d26\u53f7 %s' % fapiao_info['fapiao_bank_name'])\n    #print('=' * 50)\n    return fapiao_info\n\ndef Save_txt(text_info, out_file):\n    # \u628a\u83b7\u53d6\u7684\u4fe1\u606f\u4fdd\u5b58\u5230txt\u6587\u6863\n    # text_info : str or list ('\u53d1\u7968\u4ee3\u7801888888888888\u53d1\u7968\u53f7\u780188888888...' or ['\u53d1\u7968\u4ee3\u7801', '888888888888', '\u53d1\u7968\u53f7\u7801', '88888888', ...])\n    # out_file : str ('C:\\\\Windows\\\\Temp\\\\temp.txt')\n\n    if isinstance(text_info, list):\n        out_text = ''.join(text_info).encode('utf-8')\n    elif isinstance(text_info, str):\n        out_text = text_info.encode('utf-8')\n    # \u4fdd\u5b58\u8bfb\u53d6\u7684\u4fe1\u606f\n    with open(out_file, 'ab') as file_object:\n        file_object.write(b\"%s\\n\" % out_text)\n        file_object.close()\n    return out_file\n\ndef Save_xlsx(text_info, out_file):\n    # \u4fdd\u5b58\u53d1\u7968\u4fe1\u606f\u5230EXCEL\u6587\u6863\n    # text_info : list ([{'\u53d1\u7968\u4ee3\u7801': '888888888888', '\u53d1\u7968\u53f7\u7801': '88888888', ...}, {'\u53d1\u7968\u4ee3\u7801': '888888888888', '\u53d1\u7968\u53f7\u7801': '88888888', ...}])\n    # out_file : str ('C:\\\\Windows\\\\Temp\\\\temp.xlsx')\n\n    pf = pandas.DataFrame(text_info)\n\n    # \u6307\u5b9a\u5217\u7684\u987a\u5e8f\n    order = [\"\u53d1\u7968\u4ee3\u7801\", \"\u53d1\u7968\u53f7\u7801\", \"\u5f00\u7968\u65e5\u671f\", \"\u6821\u9a8c\u7801\", \"\u8d2d\u4e70\u65b9\u540d\u79f0\", '\u8d2d\u4e70\u65b9\u7eb3\u7a0e\u4eba\u8bc6\u522b\u53f7', \"\u4ef7\u7a0e\u5408\u8ba1\", \"\u670d\u52a1\u540d\u79f0\", \"\u9500\u552e\u65b9\u540d\u79f0\", \"\u9500\u552e\u65b9\u7eb3\u7a0e\u4eba\u8bc6\u522b\u53f7\", \"\u9500\u552e\u65b9\u5730\u5740\u3001\u7535\u8bdd\", \"\u9500\u552e\u65b9\u5f00\u6237\u884c\u53ca\u8d26\u53f7\"]\n    pf = pf[order]\n    # \u6253\u5f00excel\u6587\u4ef6\n    file_path = pandas.ExcelWriter(out_file)\n    # \u66ff\u6362\u7a7a\u5355\u5143\u683c\n    pf.fillna(' ', inplace=True)\n    # \u8f93\u51fa\n    pf.to_excel(file_path, encoding='utf-8', index=False, sheet_name=\"sheet1\")\n    file_path.save()\n    return out_file\n\ndef Filter_name(f_text):\n    # \u8fc7\u6ee4\u4f01\u4e1a\u540d\u5b57\u5934\u548c\u5c3e\n    # f_text : str (XXXX\u6709\u9650\u516c\u53f8)\n\n    try:\n        filter_name = \"START%sEND\" % re.findall('.*?\u516c\u53f8', f_text)[0]\n    except:\n        filter_name = \"START%sEND\" % f_text\n    for filter_s in cn_region:\n        filter_name = filter_name.replace(\"START%s\u5e02\" % filter_s, '')\n    for filter_s in cn_region:\n        filter_name = filter_name.replace(\"START%s\" % filter_s, '')\n    for filter_s in company_name_filter:\n        filter_name = filter_name.replace(\"%sEND\" % filter_s, '')\n    for filter_s in region_filter:\n        filter_name = filter_name.replace(\"START%s\" % filter_s, '')\n    filter_name = filter_name.replace(\"START\", '')\n    filter_name = filter_name.replace(\"END\", '')\n    return filter_name\n\ndef Filter_goods(f_text):\n    # \u8fc7\u6ee4\u670d\u52a1\u540d\u79f0\uff0c\u5254\u9664\u7b2c\u4e00\u9879\n    # f_text : str ('*\u70ed\u7231\u7956\u56fd*\u670d\u52a1\u4eba\u6c11*\u5d07\u5c1a\u79d1\u5b66*\u8f9b\u52e4\u52b3\u52a8*\u56e2\u7ed3\u4e92\u52a9*\u8bda\u5b9e\u5b88\u4fe1*\u9075\u7eaa\u5b88\u6cd5*\u8270\u82e6\u594b\u6597')\n\n    if '*' in f_text:\n        # *\u53f7\u5206\u9694\uff0c\u622a\u53d6\u7b2c\u4e09\u4e2a\u4e4b\u540e\u7684\n        filter_name = f_text.split('*')[2:]\n        if filter_name == []:\n            filter_name = f_text.split('*')[1:]\n        filter_name = ''.join(filter_name)\n    else:\n        filter_name = f_text\n    # \u8fc7\u6ee4\u7b26\u53f7\n    filter_name = re.sub('\\W+', '', filter_name).replace(\"_\", '')\n    # \u622a\u53d6\u524d\u5341\u4e2a\u5b57\u7b26\n    filter_name = filter_name[:10]\n    return filter_name\n\ndef Clear_temp_file(temp_file):\n    # \u6e05\u7406\u4e34\u65f6\u6587\u4ef6\n    # temp_file : str ('C:\\\\Windows\\\\Temp\\\\temp.txt')\n\n    os.remove(temp_file)\n\ndef Is_exists(is_path, is_type):\n    # \u5224\u65ad\u76ee\u5f55\u662f\u5426\u5b58\u5728\n    # in_path : str ('C:\\\\Windows\\\\Temp')\n    # is_type : int (0: \u76ee\u5f55\u4e0d\u5b58\u5728\u629b\u51fa\u5f02\u5e38\uff0c1: \u76ee\u5f55\u4e0d\u5b58\u5728\u5219\u521b\u5efa)\n\n    is_exists = os.path.exists(is_path)\n\n    if is_exists:\n        return is_path\n    \n    if is_type == 0:\n        raise UserWarning(u\"config: %s \u4e0d\u5b58\u5728\u6b64\u76ee\u5f55 \" % is_path)\n    elif is_type == 1:\n        os.makedirs(is_path)\n\n    return is_path\n\ndef New_file_name(text_info, file_format, file_join):\n    # \u751f\u6210\u65b0\u6587\u4ef6\u540d\u5b57\n    # text_info : list ([{'\u53d1\u7968\u4ee3\u7801': '888888888888', '\u53d1\u7968\u53f7\u7801': '88888888', ...}, {'\u53d1\u7968\u4ee3\u7801': '888888888888', '\u53d1\u7968\u53f7\u7801': '88888888', ...}])\n    # file_format : list (['\u8d2d\u4e70\u65b9\u540d\u79f0', '\u53d1\u7968\u53f7\u7801', '\u5f00\u7968\u65e5\u671f', '\u670d\u52a1\u540d\u79f0', '\u4ef7\u7a0e\u5408\u8ba1', '\u9500\u552e\u65b9\u540d\u79f0'])\n    # file_join : str ('-')\n\n    file_format_list = []\n    for order_name in [fapiao_order[s_name] for s_name in file_format]:\n        if order_name == 'fapiao_buyer_name':\n            filter_info = Filter_name(text_info[order_name])\n            if filter_info in company_name.keys():\n                filter_info = company_name[buyer_name]\n        elif order_name == 'fapiao_seller_name':\n            filter_info = Filter_name(text_info[order_name])\n        elif order_name == 'fapiao_goods':\n            filter_info = Filter_goods(text_info[order_name])\n        else:\n            filter_info = text_info[order_name]\n        file_format_list.append(filter_info)\n\n    return file_join.join(file_format_list)\n<\/code><\/pre><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u8bfb\u53d6\u65b9\u6cd5\uff1a\u91c7\u7528PDF\u8f6cDOCX\uff0c\u89e3\u538bDOCX\u4f7f\u7528xml\u8bfb\u53d6word\/document.xml\u6587\u5b57\uff0c\u83b7\u53d6\u51fa\u6240\u6709\u6587\u5b57\u7c7bw:t\u8282\u70b9nodeValue\u503c\uff0cre\u8fc7\u6ee4\u51fa\u53d1\u7968\u5185\u5bb9\u3002 Github \u5730\u5740:\uff1ahttps:\/\/github.com\/hefaxing\/fapiao_read \u4ed4\u7ec6\u770bconfig.ini\uff0c\u4fee\u6539\u76f8\u5e94\u4fe1\u606f\uff0c\u6d4b\u8bd5\u8fd0\u884c\u51e0\u6b21\u5c31\u61c2\u4e86\u3002 \u5404\u4e2a\u65b9\u6cd5\u4ee3\u7801\u5c55\u793a\uff08\u8bf7\u52ff\u76f4\u63a5\u590d\u5236\u8fd0\u884c\uff0c\u6ca1\u6709\u4e3b\u4f53\u8c03\u7528\uff0c\u8bf7\u79fb\u6b65Githu&hellip; <a class=\"more-link\" href=\"https:\/\/www.cygzs.net\/?p=261\">(more)<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_owldraft_subtitle":"","footnotes":""},"categories":[12,4],"tags":[20,21,23],"class_list":["post-261","post","type-post","status-publish","format-standard","hentry","category-python","category-develop","tag-pythonpdf","tag-pdf","tag-23"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python\u8bfb\u53d6PDF\u53d1\u7968\u4fe1\u606f - \u7433\u6d77\u5bb6\u56ed<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cygzs.net\/?p=261\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python\u8bfb\u53d6PDF\u53d1\u7968\u4fe1\u606f - \u7433\u6d77\u5bb6\u56ed\" \/>\n<meta property=\"og:description\" content=\"\u8bfb\u53d6\u65b9\u6cd5\uff1a\u91c7\u7528PDF\u8f6cDOCX\uff0c\u89e3\u538bDOCX\u4f7f\u7528xml\u8bfb\u53d6word\/document.xml\u6587\u5b57\uff0c\u83b7\u53d6\u51fa\u6240\u6709\u6587\u5b57\u7c7bw:t\u8282\u70b9nodeValue\u503c\uff0cre\u8fc7\u6ee4\u51fa\u53d1\u7968\u5185\u5bb9\u3002 Github \u5730\u5740:\uff1ahttps:\/\/github.com\/hefaxing\/fapiao_read \u4ed4\u7ec6\u770bconfig.ini\uff0c\u4fee\u6539\u76f8\u5e94\u4fe1\u606f\uff0c\u6d4b\u8bd5\u8fd0\u884c\u51e0\u6b21\u5c31\u61c2\u4e86\u3002 \u5404\u4e2a\u65b9\u6cd5\u4ee3\u7801\u5c55\u793a\uff08\u8bf7\u52ff\u76f4\u63a5\u590d\u5236\u8fd0\u884c\uff0c\u6ca1\u6709\u4e3b\u4f53\u8c03\u7528\uff0c\u8bf7\u79fb\u6b65Githu&hellip; (more)\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cygzs.net\/?p=261\" \/>\n<meta property=\"og:site_name\" content=\"\u7433\u6d77\u5bb6\u56ed\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-21T04:00:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-21T04:05:06+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"cy\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.cygzs.net\/#website\",\"url\":\"https:\/\/www.cygzs.net\/\",\"name\":\"\\u7433\\u6d77\\u5bb6\\u56ed\",\"description\":\"\\u4e00\\u4e2a\\u4e0d\\u52a1\\u6b63\\u4e1a\\u7684\\u8fd0\\u7ef4\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.cygzs.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.cygzs.net\/?p=261#webpage\",\"url\":\"https:\/\/www.cygzs.net\/?p=261\",\"name\":\"Python\\u8bfb\\u53d6PDF\\u53d1\\u7968\\u4fe1\\u606f - \\u7433\\u6d77\\u5bb6\\u56ed\",\"isPartOf\":{\"@id\":\"https:\/\/www.cygzs.net\/#website\"},\"datePublished\":\"2021-08-21T04:00:48+00:00\",\"dateModified\":\"2021-08-21T04:05:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.cygzs.net\/#\/schema\/person\/6db5162177413ff7529e7d15140c864a\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.cygzs.net\/?p=261#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.cygzs.net\/?p=261\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.cygzs.net\/?p=261#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\\u9996\\u9875\",\"item\":\"https:\/\/www.cygzs.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\\u8bfb\\u53d6PDF\\u53d1\\u7968\\u4fe1\\u606f\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.cygzs.net\/#\/schema\/person\/6db5162177413ff7529e7d15140c864a\",\"name\":\"cy\",\"sameAs\":[\"http:\/\/www.cygzs.net\"],\"url\":\"https:\/\/www.cygzs.net\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python\u8bfb\u53d6PDF\u53d1\u7968\u4fe1\u606f - \u7433\u6d77\u5bb6\u56ed","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cygzs.net\/?p=261","og_locale":"zh_CN","og_type":"article","og_title":"Python\u8bfb\u53d6PDF\u53d1\u7968\u4fe1\u606f - \u7433\u6d77\u5bb6\u56ed","og_description":"\u8bfb\u53d6\u65b9\u6cd5\uff1a\u91c7\u7528PDF\u8f6cDOCX\uff0c\u89e3\u538bDOCX\u4f7f\u7528xml\u8bfb\u53d6word\/document.xml\u6587\u5b57\uff0c\u83b7\u53d6\u51fa\u6240\u6709\u6587\u5b57\u7c7bw:t\u8282\u70b9nodeValue\u503c\uff0cre\u8fc7\u6ee4\u51fa\u53d1\u7968\u5185\u5bb9\u3002 Github \u5730\u5740:\uff1ahttps:\/\/github.com\/hefaxing\/fapiao_read \u4ed4\u7ec6\u770bconfig.ini\uff0c\u4fee\u6539\u76f8\u5e94\u4fe1\u606f\uff0c\u6d4b\u8bd5\u8fd0\u884c\u51e0\u6b21\u5c31\u61c2\u4e86\u3002 \u5404\u4e2a\u65b9\u6cd5\u4ee3\u7801\u5c55\u793a\uff08\u8bf7\u52ff\u76f4\u63a5\u590d\u5236\u8fd0\u884c\uff0c\u6ca1\u6709\u4e3b\u4f53\u8c03\u7528\uff0c\u8bf7\u79fb\u6b65Githu&hellip; (more)","og_url":"https:\/\/www.cygzs.net\/?p=261","og_site_name":"\u7433\u6d77\u5bb6\u56ed","article_published_time":"2021-08-21T04:00:48+00:00","article_modified_time":"2021-08-21T04:05:06+00:00","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"cy","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.cygzs.net\/#website","url":"https:\/\/www.cygzs.net\/","name":"\u7433\u6d77\u5bb6\u56ed","description":"\u4e00\u4e2a\u4e0d\u52a1\u6b63\u4e1a\u7684\u8fd0\u7ef4","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cygzs.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"WebPage","@id":"https:\/\/www.cygzs.net\/?p=261#webpage","url":"https:\/\/www.cygzs.net\/?p=261","name":"Python\u8bfb\u53d6PDF\u53d1\u7968\u4fe1\u606f - \u7433\u6d77\u5bb6\u56ed","isPartOf":{"@id":"https:\/\/www.cygzs.net\/#website"},"datePublished":"2021-08-21T04:00:48+00:00","dateModified":"2021-08-21T04:05:06+00:00","author":{"@id":"https:\/\/www.cygzs.net\/#\/schema\/person\/6db5162177413ff7529e7d15140c864a"},"breadcrumb":{"@id":"https:\/\/www.cygzs.net\/?p=261#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cygzs.net\/?p=261"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.cygzs.net\/?p=261#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.cygzs.net\/"},{"@type":"ListItem","position":2,"name":"Python\u8bfb\u53d6PDF\u53d1\u7968\u4fe1\u606f"}]},{"@type":"Person","@id":"https:\/\/www.cygzs.net\/#\/schema\/person\/6db5162177413ff7529e7d15140c864a","name":"cy","sameAs":["http:\/\/www.cygzs.net"],"url":"https:\/\/www.cygzs.net\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/www.cygzs.net\/index.php?rest_route=\/wp\/v2\/posts\/261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cygzs.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cygzs.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cygzs.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cygzs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=261"}],"version-history":[{"count":3,"href":"https:\/\/www.cygzs.net\/index.php?rest_route=\/wp\/v2\/posts\/261\/revisions"}],"predecessor-version":[{"id":265,"href":"https:\/\/www.cygzs.net\/index.php?rest_route=\/wp\/v2\/posts\/261\/revisions\/265"}],"wp:attachment":[{"href":"https:\/\/www.cygzs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cygzs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cygzs.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}