当前位置: 首页 > news >正文

公司网站建设需要咨询什么问题广州木马网站建设公司

公司网站建设需要咨询什么问题,广州木马网站建设公司,购物商城网站都有哪些功能,网站备案跟网安备案区别python 使用reportlab打造29页图文并茂pdf(全网reportlab最强pdf自动化生成代码#xff09; 这次项目所使用的代码如果同志们可以灵活使用#xff0c;基本上可以解决百分之九十以上的pdf模板自动化生成。 最近博主#xff0c;做了一个项目#xff0c;使用reportlab制作pd…python 使用reportlab打造29页图文并茂pdf(全网reportlab最强pdf自动化生成代码 这次项目所使用的代码如果同志们可以灵活使用基本上可以解决百分之九十以上的pdf模板自动化生成。 最近博主做了一个项目使用reportlab制作pdf博主打算把代码分享出来先看一下博主生成的pdf: 以上就是这次项目生成的pdf使用的数据我就不分享了下面是代码。 注代码需要有一点编程灵性才能看懂另外数据集博主就不分享了设计一些商业机密感兴趣的同学可以好好学习一下。 #encodinggbk import cv2 from reportlab.pdfgen import canvas from PIL import Image #encodinggbk from reportlab.pdfbase import pdfmetrics # 注册字体 from reportlab.pdfbase.ttfonts import TTFont # 字体类 from reportlab.platypus import Table, SimpleDocTemplate, Paragraph, Image # 报告内容相关类 from reportlab.lib.pagesizes import letter # 页面的标志尺寸(8.5*inch, 11*inch) from reportlab.lib.styles import getSampleStyleSheet # 文本样式 from reportlab.lib import colors # 颜色模块 from reportlab.graphics.charts.barcharts import VerticalBarChart # 图表类 from reportlab.graphics.charts.legends import Legend # 图例类 from reportlab.graphics.shapes import Drawing # 绘图工具 from reportlab.lib.units import cm # 单位cm from reportlab.platypus import BaseDocTemplate, Paragraph, Table, Spacer, PageBreak, Image, PageTemplate, \Frame, NextPageTemplate, FrameBreak from reportlab.lib.units import inch import json with open(./res_summary.json, r, encodingutf-8) as f:contentz json.load(f)# for key in contentz.keys(): # print(key,contentz[key])# 注册字体(提前准备好字体文件, 如果同一个文件需要多种字体可以注册多个) pdfmetrics.registerFont(TTFont(SimSun, simsun.ttc)) pdfmetrics.registerFont(TTFont(SimSunb, ssb.ttf)) #C:\Users\Administrator\source\repos\latex\latex\simsun.ttc class Graphs:# 绘制标题staticmethoddef draw_title(title: str):# 获取所有样式表style getSampleStyleSheet()# 拿到标题样式ct style[Heading1]# 单独设置样式相关属性ct.fontName SimSunb # 字体名ct.fontSize 23 # 字体大小ct.leading 40 # 行间距ct.textColor colors.black # 字体颜色ct.alignment 1 # 居中ct.bold 10ct.leftMargin 120#改左边距ct.rightMargin 120# 创建标题对应的段落并且返回return Paragraph(title, ct)# 绘制小标题staticmethoddef draw_little_title(title: str):# 获取所有样式表style getSampleStyleSheet()# 拿到标题样式ct style[Normal]# 单独设置样式相关属性ct.fontName SimSun # 字体名ct.fontSize 15 # 字体大小ct.leading 30 # 行间距ct.textColor colors.red # 字体颜色# 创建标题对应的段落并且返回return Paragraph(title, ct)# 绘制普通段落内容staticmethoddef draw_text(text: str):# 获取所有样式表style getSampleStyleSheet()# 获取普通样式ct style[Normal]ct.fontName SimSunct.fontSize 12ct.wordWrap CJK # 设置自动换行ct.alignment 0 # 左对齐ct.firstLineIndent 32 # 第一行开头空格ct.leading 30return Paragraph(str(text), ct)def draw_text_2(text: str):# 获取所有样式表style getSampleStyleSheet()# 获取普通样式ct style[Normal]ct.fontName SimSunbct.fontSize 12ct.wordWrap CJK # 设置自动换行ct.alignment 0 # 左对齐ct.firstLineIndent 32 # 第一行开头空格ct.leading 25return Paragraph(str(text), ct)def draw_text_23(text: str):# 获取所有样式表style getSampleStyleSheet()# 获取普通样式ct style[Normal]ct.fontName SimSunbct.fontSize 12ct.wordWrap CJK # 设置自动换行ct.alignment 1 # 左对齐ct.firstLineIndent 32 # 第一行开头空格ct.leading 25return Paragraph(str(text), ct)def draw_text_5(text: str):# 获取所有样式表style getSampleStyleSheet()# 获取普通样式ct style[Normal]ct.fontName SimSunbct.fontSize 12ct.wordWrap CJK # 设置自动换行ct.alignment 0 # 左对齐ct.firstLineIndent 0 # 第一行开头空格ct.leading 30return Paragraph(str(text), ct)def draw_text_4(text: str):# 获取所有样式表style getSampleStyleSheet()# 获取普通样式ct style[Normal]ct.fontName SimSunct.fontSize 12ct.wordWrap CJK # 设置自动换行ct.alignment 0 # 左对齐ct.firstLineIndent 0 # 第一行开头空格ct.leading 30return Paragraph(str(text), ct)# 绘制表格def draw_text_3(text: str):# 获取所有样式表style getSampleStyleSheet()# 获取普通样式ct style[Normal]ct.fontName SimSunct.fontSize 12ct.wordWrap CJK # 设置自动换行ct.alignment 0 # 左对齐ct.firstLineIndent 32 # 第一行开头空格ct.leading 30return Paragraph(str(text), ct)# 绘制表格staticmethoddef draw_table(*args):# 列宽度col_width 120style [(FONTNAME, (0, 0), (-1, -1), SimSunb), # 字体(FONTSIZE, (0, 0), (-1, 0), 12), # 第一行的字体大小(FONTSIZE, (0, 1), (-1, -1), 10), # 第二行到最后一行的字体大小#(BACKGROUND, (0, 0), (-1, 0), #d5dae6), # 设置第一行背景颜色(ALIGN, (0, 0), (-1, -1), CENTER), # 第一行水平居中(ALIGN, (0, 1), (-1, -1), CENTER), # 第二行到最后一行左右左对齐(VALIGN, (0, 0), (-1, -1), MIDDLE), # 所有表格上下居中对齐(TEXTCOLOR, (0, 0), (-1, -1), colors.black), # 设置表格内文字颜色(GRID, (0, 0), (-1, -1), 0.01, colors.black), # 设置表格框线为grey色线宽为0.5# (SPAN, (0, 1), (0, 2)), # 合并第一列二三行# (SPAN, (0, 3), (0, 4)), # 合并第一列三四行# (SPAN, (0, 5), (0, 6)), # 合并第一列五六行# (SPAN, (0, 7), (0, 8)), # 合并第一列五六行]table Table(args, rowHeights48,colWidths70 ,stylestyle)return tablestaticmethoddef draw_table_z(*args):# 列宽度col_width 120style [(FONTNAME, (0, 0), (-1, -1), SimSunb), # 字体(FONTSIZE, (0, 0), (-1, 0), 15), # 第一行的字体大小(FONTSIZE, (0, 1), (-1, -1), 15), # 第二行到最后一行的字体大小#BACKGROUND, (0, 0), (-1, 0), blue), # 设置第一行背景颜色(ALIGN, (0, 0), (0, -1), CENTER), # 第水平居中(ALIGN, (1, 0), (-1, -1), LEFT), # 第二行到最后一行左右左对齐# (BACKGROUND, (0, 0), (-1, 0), blue), # 设置第一行背景颜色(VALIGN, (0, 0), (-1, -1), MIDDLE), # 所有表格上下居中对齐(TEXTCOLOR, (0, 0), (-1, -1), colors.darkslategray), # 设置表格内文字颜色(GRID, (0, 0), (-1, -1), 0.5, colors.grey), # 设置表格框线为grey色线宽为0.5# (SPAN, (0, 1), (0, 2)), # 合并第一列二三行# (SPAN, (0, 3), (0, 4)), # 合并第一列三四行# (SPAN, (0, 5), (0, 6)), # 合并第一列五六行# (SPAN, (0, 7), (0, 8)), # 合并第一列五六行(SPAN, (1, 0), (3, 0)), # 合并第一列二三行(SPAN, (1, 1), (3, 1)), # 合并第一列三四行(SPAN, (1, 2), (3, 2)), # 合并第一列五六行]table Table(args, rowHeights30,colWidths110 ,stylestyle)return tablestaticmethoddef draw_table_2(*args):# 列宽度col_width 120style [(FONTNAME, (0, 0), (-1, -1), SimSunb), # 字体(FONTSIZE, (0, 0), (-1, 0), 12), # 第一行的字体大小(FONTSIZE, (0, 1), (-1, -1), 10), # 第二行到最后一行的字体大小#(BACKGROUND, (0, 0), (-1, 0), #d5dae6), # 设置第一行背景颜色(ALIGN, (0, 0), (-1, -1), CENTER), # 第一行水平居中(ALIGN, (0, 1), (-1, -1), CENTER), # 第二行到最后一行左右左对齐(VALIGN, (0, 0), (-1, -1), MIDDLE), # 所有表格上下居中对齐(TEXTCOLOR, (0, 0), (-1, -1), colors.black), # 设置表格内文字颜色(GRID, (0, 0), (-1, -1), 0.01, colors.black), # 设置表格框线为grey色线宽为0.5# (SPAN, (0, 1), (0, 2)), # 合并第一列二三行# (SPAN, (0, 3), (0, 4)), # 合并第一列三四行# (SPAN, (0, 5), (0, 6)), # 合并第一列五六行# (SPAN, (0, 7), (0, 8)), # 合并第一列五六行]table Table(args, rowHeights48,colWidths60 ,stylestyle)return tablestaticmethoddef draw_table_3(*args):# 列宽度col_width 120style [(FONTNAME, (0, 0), (-1, -1), SimSunb), # 字体(FONTSIZE, (0, 0), (-1, 0), 12), # 第一行的字体大小(FONTSIZE, (0, 1), (-1, -1), 10), # 第二行到最后一行的字体大小#(BACKGROUND, (0, 0), (-1, 0), #d5dae6), # 设置第一行背景颜色(ALIGN, (0, 0), (-1, -1), CENTER), # 第一行水平居中(ALIGN, (0, 1), (-1, -1), CENTER), # 第二行到最后一行左右左对齐(VALIGN, (0, 0), (-1, -1), MIDDLE), # 所有表格上下居中对齐(TEXTCOLOR, (0, 0), (-1, -1), colors.darkslategray), # 设置表格内文字颜色(GRID, (0, 0), (-1, -1), 0.1, colors.black), # 设置表格框线为grey色线宽为0.5# (SPAN, (0, 1), (0, 2)), # 合并第一列二三行# (SPAN, (0, 3), (0, 4)), # 合并第一列三四行# (SPAN, (0, 5), (0, 6)), # 合并第一列五六行# (SPAN, (0, 7), (0, 8)), # 合并第一列五六行]table Table(args, rowHeights48,colWidths60 ,stylestyle)return tablestaticmethoddef draw_table_first(*args):# 列宽度col_width 100style [(FONTNAME, (0, 0), (-1, -1), SimSunb), # 字体(FONTSIZE, (0, 0), (-1, 0), 15), # 第一行的字体大小(FONTSIZE, (0, 1), (-1, -1), 15), # 第二行到最后一行的字体大小#BACKGROUND, (0, 0), (-1, 0), blue), # 设置第一行背景颜色(ALIGN, (0, 0), (0, -1), CENTER), # 第水平居中(ALIGN, (1, 0), (-1, -1), LEFT), # 第二行到最后一行左右左对齐(BACKGROUND, (0, 0), (-1, 0), blue), # 设置第一行背景颜色(VALIGN, (0, 0), (-1, -1), MIDDLE), # 所有表格上下居中对齐(TEXTCOLOR, (0, 0), (-1, -1), colors.darkslategray), # 设置表格内文字颜色(GRID, (0, 0), (-1, -1), 0.5, colors.grey), # 设置表格框线为grey色线宽为0.5(SPAN, (1, 0), (3, 0)), # 合并第一列二三行(SPAN, (1, 1), (3, 1)), # 合并第一列三四行(SPAN, (1, 2), (3, 2)), # 合并第一列五六行(SPAN, (1, 3), (3, 3)), # 合并第一列五六行(SPAN, (1, 4), (3, 4)), # 合并第一列五六行(SPAN, (1, 5), (3, 5)), # 合并第一列五六行(SPAN, (1, 6), (3, 6)), # 合并第一列五六行]table Table(args, rowHeights43,colWidths110, stylestyle)return table# 创建图表# 绘制图片staticmethoddef draw_img_first(path):image cv2.imread(path) # 逐个读取img Image(path) # 读取指定路径下的图片img.drawWidth 10*cm # 设置图片的宽度img.drawHeight 10*cm # 设置图片的高度return imgstaticmethoddef draw_img_first(path):image cv2.imread(path) # 逐个读取if(image.shape[0]*image.shape[1]30000000):print(dd,image.shape)imagecv2.resize(image,(int(image.shape[0]*0.6),int(image.shape[1]*0.6)))cv2.imwrite(E:\\work\\10-23\\input\\results\\secs\\z.png,image)img Image(E:\\work\\10-23\\input\\results\\secs\\z.png) # 读取指定路径下的图片# img.drawWidth 5*cm # 设置图片的宽度# img.drawHeight 8*cm # 设置图片的高度return imgimg Image(path) # 读取指定路径下的图片img.drawWidth 3*cm # 设置图片的宽度img.drawHeight 3*cm # 设置图片的高度return imgimport csv def read_csv(path):listz[]p0with open(path, r, encodingutf-8) as csv_f:reader csv.reader(csv_f)for row in reader:# print(row)if p!0:print(row[0])stfor s in row[0][0:]:if 0s and s9:ststsif s in [,, ]:breakrow[0]int(st)pp1listz.append(row)return listz import datetime from reportlab.lib.units import inch, cm from reportlab.pdfbase import pdfmetrics, ttfonts from reportlab.lib.styles import getSampleStyleSheet from reportlab.platypus import SimpleDocTemplate, Paragraph, PageBreak, Spacer def myFirstPage(canvas, doc):第一页页眉页脚配置:param canvas: 绘画对象用来写入页眉页脚:param doc: 文档对象可以以此得知文档的页边距信息:return:# 文档宽度高度(width、height)左右页边距(leftMargin、rightMargin)、上下页边距(topMargin、bottomMargin)totalPageHeight doc.bottomMargin doc.height doc.topMargin # 页面总高度totalPageWidth doc.leftMargin doc.width doc.rightMargin # 页面总宽度# 保存之前的画笔格式等状态,并设置新的状态canvas.saveState() # 设置字体及大小canvas.setFont(SimSun, 12)# 添置靠左页眉print(doc.leftMargin, totalPageHeight - doc.topMargin)canvas.drawImage(rMD_logo.png, 0, 785, 5.2* cm, 2 * cm)canvas.restoreState()def myLaterPages(canvas, doc):除第一页外其它页的页眉页脚配置:param self::param canvas::param doc::return:totalPageWidth doc.leftMargin doc.width doc.rightMargincanvas.saveState()canvas.setFont(SimSun, 9)# 添置居中页脚canvas.drawString(totalPageWidth / 2.0, doc.bottomMargin, {}.format(doc.page))canvas.restoreState()# # print(fdsfdsa,res_summary[project_bird_view_path])# content.append(Graphs.draw_text(res_summary[project_name]))#003# content.append(Graphs.draw_text(res_summary[project_unit]))#004# content.append(Graphs.draw_text(res_summary[manage_unit]))#005# content.append(Graphs.draw_text(res_summary[construction_unit]))#006 # content.append(Graphs.draw_text(res_summary[inspection_unit]))##007 # content.append(Graphs.draw_text(res_summary[inspector]))#008 # content.append(Graphs.draw_text(res_summary[inspection_time]))#009## # content.append(Graphs.draw_text(res_summary[wall_loc]))#010 # content.append(Graphs.draw_text(res_summary[wall_stage]))#011# content.append(Graphs.draw_text(res_summary[scoring_dist_thresh_flatness]))#012 # content.append(Graphs.draw_text(res_summary[scoring_dist_thresh_perpendicularity]))#012# content.append(Graphs.draw_img(res_summary[wall_camera_view_path]))#013# content.append(Graphs.draw_img(res_summary[pcd_camera_view_path]))#014# content.append(Graphs.draw_img(res_summary[sec_heat_info][heat_map_path]))#015# #print(res_summary[flatness_secs_info][statistics_measure]) # # # print(list_data)#for key in res_summary[flatness_secs_info][defect_map_infos]:# content.append(Graphs.draw_text(key[floors_num]))#023# content.append(Graphs.draw_img(key[img_path]))#023 # # #print(res_summary[sec_heat_info][statistics_pts][secs_res_path]) # list_dataread_csv(res_summary[sec_heat_info][statistics_pts][secs_res_path])# content.append(Graphs.draw_table(*list_data))#017# content.append(Graphs.draw_text(res_summary[sec_heat_info][statistics_pts][valid_avg]))#018 # content.append(Graphs.draw_text(res_summary[sec_heat_info][statistics_pts][score_avg]))#019 # #content.append(Graphs.draw_text(res_summary[scoring_dist_thresh_perpendicularity]))#012# lsiz res_summary[perpendicularity_secs_info][worst_se_map_infos] # for key in res_summary[flatness_secs_info][worst_se_map_infos]: # # print(key[floors_num]) # content.append(Graphs.draw_text(key[floors_num]))#020# content.append(Graphs.draw_img(key[img_path]))#021# for k in lsiz: # # print(k) # if(k[floors_num]key[floors_num]) : # content.append(Graphs.draw_img(k[img_path]))#022 # # print(k[img_path]) # for key in res_summary[flatness_secs_info][defect_map_infos]: # content.append(Graphs.draw_text(key[floors_num]))#023# content.append(Graphs.draw_img(key[img_path]))#023 # content.append(Graphs.draw_img(res_summary[sec_heat_info][heat_map_path]))#024 from reportlab.lib.pagesizes import A4 from reportlab.platypus import SimpleDocTemplate, Paragraph, Table, TableStyle, Image if __name__ __main__:# 创建内容对应的空列表content list()res_summarycontentzcontent.append(Graphs.draw_title(元宇智数(深圳科技有限公司))content.append(Graphs.draw_title(外墙检测诊断报告书))b[[项目名称,res_summary[project_name],,],[建设单位,res_summary[project_unit],,],[监理单位,res_summary[manage_unit],,],[施工单位,res_summary[construction_unit],,],[检测单位,res_summary[inspection_unit],,],[测量员,res_summary[inspector],,],[测量时间,res_summary[inspection_time],,]]# 添加图片# # print(fdsfdsa,res_summary[project_bird_view_path])p1 Image(res_summary[project_bird_view_path],250,250)content.append(p1)content.append(Graphs.draw_text_3(i /ibr/))content.append(Graphs.draw_table_first(*b))content.append(Graphs.draw_title(res_summary[wall_loc]外墙检测现场情况))# content.append(Graphs.draw_text_3(i /ibr/))a检测阶段res_summary[wall_stage]b检测标准str(res_summary[scoring_dist_thresh_flatness])c检测设备str(res_summary[scoring_dist_thresh_flatness])sabr/bbr/clb[[检测阶段,res_summary[wall_stage],,],[检测标准,str(res_summary[scoring_dist_thresh_flatness]),,],[检测设备,str(res_summary[scoring_dist_thresh_flatness]),,]]#draw_table_zcontent.append(Graphs.draw_table_z(*lb))# content.append(Graphs.draw_text_2(b))# content.append(Graphs.draw_text_2(c))# canvas.drawImage(res_summary[wall_camera_view_path], inch*.25, inch*.25, 100-(.5*inch), (.316*inch))#canvas.drawImage(res_summary[wall_camera_view_path], inch*.25, inch*.25, 100-(.5*inch), (.316*inch))p13 Image(res_summary[wall_camera_view_path],200,455)p14Image(res_summary[pcd_camera_view_path],200,455)data [[p13,p14 ]]tTable(data,style[(GRID,(0,0),(-1,-1),2,colors.white),(VALIGN, (0, 0), (-1, -1), MIDDLE), # 所有表格上下居中对齐], rowHeights460,colWidths220)content.append(Graphs.draw_text(br/br/))content.append(t)content.append(Graphs.draw_title(检测设备参数))sFARO P350 双轴补偿器:对每次扫描进行水平校准精度达到 19 角秒\误差范围±2° 高度传感器:通过电子气压计可测得与固定点相对的高度并将其br/添加至扫描指南针 电子指南针可指示扫描的方向 GNSS:集成 GPS 和br/GLONASS 现场补偿创建当前质量报告并为自动改进设备补偿提供了选项。br/s3外部环境br/s2重量(包括电池): 4.2kg 尺寸: 230 x 183 x 103mmbr/电源电压: 19V (外置电源)14.4V (内部电池)br/功耗: 15W(待机时)25W(扫描时)80W充电时br/\ 电池使用时间: 4.5 小时br/\ 工作温度: 5° - 40°Cbr/\ 扩展工作温度: -20° - 55°Cbr/\ 贮存温度: -10° - 60°Cbr/\ 防护等级: IP54br/\ 湿度: 无凝结。br/br/br/p4 Image(p2.png,100,150)content.append(p4)content.append(Graphs.draw_text_3(s))content.append(Graphs.draw_text_5(s3))content.append(Graphs.draw_text_4(s2))content.append(Graphs.draw_text_3(i /ibr/))# content.append(Graphs.draw_text())content.append(Graphs.draw_title(外墙面热力图))# content.append(Graphs.draw_text_3(i /ibr/))p13 Image(res_summary[wall_camera_view_path],200,590)patzD:\work\latex\data\\z.pngdef p_z(path):image cv2.imread(path) # 逐个读取if(image.shape[0]*image.shape[1]1000000):print(dd,image.shape)imagecv2.resize(image,(int(image.shape[0]*0.5),int(image.shape[1]*0.5)))cv2.imwrite(patz,image)# img Image(E:\\work\\10-23\\input\\results\\secs\\z.png) else:cv2.imwrite(patz,image)p_z(res_summary[sec_heat_info][heat_map_path])p15Image(patz,7*cm,21*cm)data [[p13,p15 ]]tTable(data,style[(GRID,(0,0),(-1,-1),2,colors.white)], rowHeights600,colWidths240)content.append(t)content.append(Graphs.draw_title(墙面各层区间下尺检测结果))list_dataread_csv(res_summary[flatness_secs_info][statistics_measure])content.append(Graphs.draw_table(*list_data))#016content.append(Graphs.draw_text_3(i /ibr/))content.append(Graphs.draw_title(墙面满测检测结果))list_dataread_csv(res_summary[sec_heat_info][statistics_pts][secs_res_path])content.append(Graphs.draw_table_2(*list_data))#017content.append(Graphs.draw_text_3(i /ibr/))lsiz res_summary[perpendicularity_secs_info][worst_se_map_infos]# data [[p13,p14 ]]sty[ (SPAN, (0, 0), (3, 0)),(SPAN, (4, 0), (7, 0)) , (SPAN, (0, 1), (3, 11)) , (SPAN, (4, 1), (7, 11)) , (FONTNAME, (0, 0), (-1, -1), SimSun), # 字体(FONTSIZE, (0, 0), (-1, 0), 15), # 第一行的字体大小(FONTSIZE, (0, 1), (-1, -1), 15), # 第二行到最后一行的字体大小#(BACKGROUND, (0, 0), (-1, 0), #d5dae6), # 设置第一行背景颜色(ALIGN, (0, 0), (-1, -1), CENTER), # 第一行水平居中(ALIGN, (0, 1), (-1, -1), CENTER), # 第二行到最后一行左右左对齐(VALIGN, (0, 0), (-1, -1), MIDDLE), # 所有表格上下居中对齐(TEXTCOLOR, (0, 0), (-1, -1), colors.darkslategray), # 设置表格内文字颜色(GRID, (0, 0), (-1, -1), 0.1, colors.black), # 设置表格框线为grey色线宽为0.5] # 合并第一列二三行,]#(GRID,(0,0),(-1,-1),2,colors.white)####**********zlist_datafor key in res_summary[flatness_secs_info][worst_se_map_infos]:# print(key[floors_num])# content.append(Graphs.draw_text(key[floors_num]))#020if key[floors_num][0]!33:content.append(Graphs.draw_title(str(key[floors_num][0])-str(key[floors_num][1])层区间-垂平数据结果))else:content.append(Graphs.draw_title(str(key[floors_num][0])层以上-垂平数据结果))p16Image(key[img_path],8*cm,16*cm)list_datazlist_data[0][0]外墙平整度list_data[0][4]外墙垂直度list_data[1][0]p16# content.append(p16)#021for k in lsiz:# print(k)if(k[floors_num]key[floors_num]) :# content.append(Graphs.draw_img(k[img_path]))#022p16Image(k[img_path],8*cm,16*cm)# content.append(p16)#021list_data[1][4]p16tTable(list_data,stylesty, rowHeights50,colWidths65)content.append(t)# print(k[img_path]) content.append(Graphs.draw_text_3(i /ibr/))sty2[ (SPAN, (0, 0), (7, 0)),(SPAN, (0, 1), (7, 11)) , (FONTNAME, (0, 0), (-1, -1), SimSun), # 字体(FONTSIZE, (0, 0), (-1, 0), 15), # 第一行的字体大小(FONTSIZE, (0, 1), (-1, -1), 15), # 第二行到最后一行的字体大小#(BACKGROUND, (0, 0), (-1, 0), #d5dae6), # 设置第一行背景颜色(ALIGN, (0, 0), (-1, -1), CENTER), # 第一行水平居中(ALIGN, (0, 1), (-1, -1), CENTER), # 第二行到最后一行左右左对齐(VALIGN, (0, 0), (-1, -1), MIDDLE), # 所有表格上下居中对齐(TEXTCOLOR, (0, 0), (-1, -1), colors.darkslategray), # 设置表格内文字颜色(GRID, (0, 0), (-1, -1), 0.1, colors.black), # 设置表格框线为grey色线宽为0.5] # 合并第一列二三行,]#(GRID,(0,0),(-1,-1),2,colors.white)list_zres_summary[flatness_secs_info][defect_map_infos]for i in range(0,len(list_z),2):content.append(Graphs.draw_title(缺陷修补建议图))list_datazlist_data[0][0]str(list_z[i][floors_num][0])-str(list_z[i][floors_num][1])层区间p16Image(list_z[i][img_path],8*cm,16*cm)list_data[1][0]p16try:list_data[0][4]str(list_z[i1][floors_num][0])-str(list_z[i1][floors_num][1])层区间p16Image(list_z[i1][img_path],8*cm,16*cm)list_data[1][4]p16tTable(list_data,stylesty, rowHeights50,colWidths65)content.append(t)content.append(Graphs.draw_text_3(i /ibr/))ii1except:#list_data[0][4]#list_data[1][4]list_data[0][0]str(list_z[i][floors_num][0])层以上p16Image(list_z[i][img_path],12*cm,16*cm)list_data[1][0]p16tTable(list_data,stylesty2, rowHeights50,colWidths65)content.append(t)content.append(Graphs.draw_text_3(i /ibr/))ii1content.append(Graphs.draw_title(层间K板接缝处检测数据结果))content.append(Graphs.draw_text_23(上下各延展1.2米客户定制检测内容))# p16Image(res_summary[sec_heat_info][heat_map_path],300,600)print(res_summary[sec_heat_info][heat_map_path])p_z(res_summary[sec_heat_info][heat_map_path])p15Image(patz,300,600)content.append(p15)#024styz[ (SPAN, (0, 0), (3, 0)),(SPAN, (4, 0), (7, 0)) , (SPAN, (0, 1), (3, 5)) , (SPAN, (4, 1), (7, 5)) , (SPAN, (0, 6), (3, 6)),(SPAN, (4, 6), (7, 6)) , (SPAN, (0, 7), (3, 11)) , (SPAN, (4, 7), (7, 11)) , (FONTNAME, (0, 0), (-1, -1), SimSun), # 字体(FONTSIZE, (0, 0), (-1, 0), 12), # 第一行的字体大小(FONTSIZE, (0, 1), (-1, -1), 12), # 第二行到最后一行的字体大小#(BACKGROUND, (0, 0), (-1, 0), #d5dae6), # 设置第一行背景颜色(ALIGN, (0, 0), (-1, -1), CENTER), # 第一行水平居中(ALIGN, (0, 1), (-1, -1), CENTER), # 第二行到最后一行左右左对齐(VALIGN, (0, 0), (-1, -1), MIDDLE), # 所有表格上下居中对齐(TEXTCOLOR, (0, 0), (-1, -1), colors.darkslategray), # 设置表格内文字颜色(GRID, (0, 0), (-1, -1), 0.1, colors.black), # 设置表格框线为grey色线宽为0.5] # 合并第一列二三行,]#(GRID,(0,0),(-1,-1),2,colors.white)# res_summary[flatness_gaps_info][worst_se_map_infos][*][floors_num]# 和# res_summary[flatness_gaps_info][defect_map_infos][*][floors_num]lsiz res_summary[flatness_gaps_info][defect_map_infos]piz0for key in res_summary[flatness_gaps_info][worst_se_map_infos]:list_datazif piz%20:pizpiz1content.append(Graphs.draw_title(层间接缝处爆尺及缺陷修补建议图))# print(fdsfds)list_data[0][0]str(key[floors_num][0])层接缝处爆尺数据list_data[0][4]str(key[floors_num][0])层接缝处缺陷修补p16Image(key[img_path],212,160)list_data[1][0]p16# content.append(Graphs.draw_img(key[img_path]))#026for k in lsiz:# print(k)if(k[floors_num]key[floors_num]) :p16Image(k[img_path],212,160)list_data[1][4]p16# content.append(Graphs.draw_img(k[img_path]))#027else:pizpiz1list_data[6][0]str(key[floors_num][0])层接缝处爆尺数据list_data[6][4]str(key[floors_num][0])层接缝处缺陷修补p16Image(key[img_path],212,160)list_data[7][0]p16for k in lsiz:# print(k)if(k[floors_num]key[floors_num]) :p16Image(k[img_path],212,160)list_data[7][4]p16# content.append(Graphs.draw_img(k[img_path]))#027tTable(list_data,stylestyz, rowHeights50,colWidths65)content.append(t)content.append(Graphs.draw_text_3(i /ibr/))# # res_summary[flatness_gaps_info][worst_se_map_infos][*][floors_num] # # 和 # # res_summary[flatness_gaps_info][defect_map_infos][*][floors_num]# lsiz res_summary[flatness_gaps_info][defect_map_infos] # for key in res_summary[flatness_gaps_info][worst_se_map_infos]: # # print(key[floors_num]) # content.append(Graphs.draw_text(key[floors_num]))#025# content.append(Graphs.draw_img(key[img_path]))#026# for k in lsiz: # # print(k) # if(k[floors_num]key[floors_num]) : # content.append(Graphs.draw_img(k[img_path]))#027# print(k[img_path]) #print(fdsfdsa,res_summary[project_bird_view_path])#content.append(Graphs.draw_img(contentz[sec_heat_info][heat_map_path]))#other/MD_logo.png# for key in contentz.keys():# pathcontentz[key]# if isinstance(path,dict):# for keyp in path.keys():# print(path[keyp]) # else:# print(path) # if path.endwith(png):# # 添加段落文字# content.append(Graphs.draw_text(众所周知大数据分析师岗位是香饽饽近几年数据分析热席卷了整个互联网行业与数据分析的相关的岗位招聘、培训数不胜数。很多人前赴后继想要参与到这波红利当中。那么数据分析师就业前景到底怎么样呢))# # 添加小标题# content.append(Graphs.draw_title())# content.append(Graphs.draw_little_title(不同级别的平均薪资))# # 添加表格# data [# (职位名称, 平均薪资, 较上年增长率),# (数据分析师, 18.5K, 25%),# (高级数据分析师, 25.5K, 14%),# (资深数据分析师, 29.3K, 10%)# ]# content.append(Graphs.draw_table(*data))# # 生成图表# content.append(Graphs.draw_title())# content.append(Graphs.draw_little_title(热门城市的就业情况))# b_data [(25400, 12900, 20100, 20300, 20300, 17400), (15800, 9700, 12982, 9283, 13900, 7623)]# ax_data [BeiJing, ChengDu, ShenZhen, ShangHai, HangZhou, NanJing]# leg_items [(colors.red, 平均薪资), (colors.green, 招聘量)]# content.append(Graphs.draw_bar(b_data, ax_data, leg_items))# 生成pdf文件doc SimpleDocTemplate(rD:\work\latex\data\report.pdf, pagesizeA4)doc.build(content,onFirstPagemyFirstPage, onLaterPagesmyFirstPage)
http://www.zqtcl.cn/news/335645/

相关文章:

  • wordpress安装路径和站点地址的设置信通网站开发中心
  • 柳州公司网站建设网站服务商
  • 智能建站实验报告成功营销网站
  • 基于jsp的网站开发开题报告青海公路工程建设市场信用信息服务网站
  • 做网站页面的软件wordpress如何开启page页面评论
  • 做网站最简单的长春财经学院
  • 导购网站 icp备案要求网站设置ico
  • ftp做网站营销策划方案步骤
  • 网站建设若干意见wordpress查看数据库密码
  • 什么网站可以做宣传西安网站建设聚星互联
  • 产品展示网站源码2015年做哪些网站致富
  • 潍坊网站制作推广怎样做彩票网站
  • 做视频网站被判刑自己怎么做企业网站建设
  • 安庆网站建设兼职哪个公司的卡网络最好
  • tp框架做响应式网站青岛网站建设首选
  • 外国自适应企业网站做网站模板用什么框架
  • win7做网站服务器隐私浏览器
  • 优秀的设计网站广州排名推广
  • 做电商设计有什么好的网站推荐软件产品开发流程图
  • 建设网站请示宣传企业网站建设的
  • 汉中定制网站建设公司网站建设建站知识
  • 做壁纸网站建站优化办事效率高
  • linux 做网站数据库怎么开发ios软件
  • 沛县网站设计html制作网页的代码
  • 南昌网站建设公司如何万维网络(临沂网站建设)
  • 张家界做网站洛阳网站建设哪家专业
  • 快餐网站模板电子版邀请函制作软件免费
  • 有什么做视频的素材网站网站名称注册保护
  • 北京 顺义 网站制作h5网站网站建设
  • 网站在百度上搜不到了wordpress导航菜单加图片