字体位置/usr/share/fonts ,将windows 下的字体上传即可。
安装 apt install libreoffice
转码 libreoffice –convert-to pdf:writer_pdf_Export m.pptx –outdir ./pdf/
字体位置/usr/share/fonts ,将windows 下的字体上传即可。
安装 apt install libreoffice
转码 libreoffice –convert-to pdf:writer_pdf_Export m.pptx –outdir ./pdf/
circuitpython 9.2.0 CPU 360MHZ RAM 33038080
圆周率计算如下图,对比rp2350(使用Micropython 1.24固件)在300MHZ下的计算圆周率速度相仿,但是未使用Micropython下比较。
| 处理器 | CPU | RAM | 版本 | 100 | 500 | 1000 | 2000 | 5000 | 10000 | |
| RP2350 | 150 | 486848 | 1.24 | 11 | 82 | 279 | 1071 | 8782 | 42860 | |
| RP2350 | 250 | 486848 | 1.24 | 7 | 49 | 167 | 643 | 5270 | 25717 | |
| RP2350 | 300 | 486848 | 1.24 | 5 | 41 | 139 | 536 | 4391 | 21430 | |
| RP2350(不稳定) | 320 | 486848 | 1.24 | 5 | 38 | 131 | 503 | 4116 | 20091 | |
| ESP32P4 | 360 | 33038080 | 9.2.0 | 4.39453 | 41.9922 | 163.086 | 532.227 | 3068.85 | 11600.1 |
pi_circuitpython.py · micropython中文社区/PiCalcTest – Gitee.com
代码整合
from PIL import Image
import os
class do_it(object):
def __init__(self):
self.download="./pdf/"
# 保存目录
def create_img_pdf(self,file_name,ouput_pdf):
page = Image.new('RGB', (2480, 3508), 'white')
image=Image.open(file_name)
i_w,i_h=image.size
if i_w>i_h:
i_n_w=2000
i_n_h=int(i_h*2000/i_w)
else:
i_n_h=3000
i_n_w=int(i_w*3000/i_h)
n_img=image.resize((i_n_w,i_n_h))
page.paste(n_img,(100,100))
page.save(ouput_pdf,"PDF", resolution=100.0)
def topdf(self,nfile):
#保存在当前的pdf文件夹
# nfile必须独一无二
com="libreoffice --convert-to pdf:writer_pdf_Export "+nfile+" --outdir "+self.download
os.system(com)
name=nfile[nfile.rfind('/')+1:nfile.rfind('.')]+".pdf"
newa=self.download+name
return newa
def combine(self,file_list,out_file):
file_info=""
for i in file_list:
file_info=file_info+" "+i
com="pdftk "+file_info+" cat output "+out_file
os.system(com)
def combine(file_list,out_file):
file_info=""
for i in file_list:
file_info=file_info+" "+i
com="pdftk "+file_info+" cat output "+out_file
os.system(com)
# libreoffice --convert-to pdf:writer_pdf_Export --outdir <保存的目录> a.docx
#保存在当前的download文件夹
def topdf(nfile):
com="libreoffice --convert-to pdf:writer_pdf_Export "+nfile+" --outdir ./download"
os.system(com)
name=nfile[nfile.rfind('/')+1:nfile.rfind('.')]+".pdf"
newa="./download/"+name
return newa