从ppt中获取文本框内容及位置信息,并写入到数据库中
import pymysql
import sys
import re
from pptx import Presentation
from pptx.util import Inches
from pptx.chart.data import ChartData
from pptx.enum.chart import XL_TICK_MARK
from pptx.util import Pt
from pptx.dml.color import RGBColor
from pptx.enum.chart import XL_DATA_LABEL_POSITION
from pptx.enum.chart import XL_LEGEND_POSITION
from pptx.enum.chart import XL_CHART_TYPE
from pptx.enum.chart import XL_MARKER_STYLE
from pptx.enum.chart import XL_TICK_LABEL_POSITION
from pptx import Presentation
from pptx.enum.text import PP_ALIGN
def fn_ppt_get_object_text(mydb,filePath):
#mydb = pymysql.connect("192.168.80.224","root","123","baoxian",port=3306,charset='utf8' )#192.168.80.224
#mydb.set_character_set('utf8')
mycursor = mydb.cursor()
mycursor.execute('SET CHARACTER SET utf8;')
mycursor.execute('SET NAMES utf8;')
mycursor.execute('SET character_set_connection=utf8;')
#fliePat

使用python-pptx库解析PPT文件,提取每个文本框的内容及其在幻灯片中的位置坐标,进一步将这些信息整理并存储到数据库中,实现自动化处理。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



