问题描述
我写了一个python脚本,我用来创建一个spreasheet与各种计算。我想进一步将pdf插入spreadhseet(pdf是可取的,但jpeg是可用的)。我一直在翻阅xlwt,找不到任何东西。任何人都可以提出一种方法来实现这一点?要实际插入PDF,您可能需要使用Excel。自动化运行的Excel实例的最方便的方法可能是VBA或VBScript,但您仍然可以使用Python与或。
如果重要的是坚持使用Python,生成 .xlsx
而不是 .xls
是可以接受的,您最好的选择是,它可以导入JPEG或PNG(除了BMP)。以下是和。
I wrote a python script that I use to create a spreasheet with various calculations. I want to further insert a pdf into the spreadhseet (pdf is desireable, but a jpeg is useable). I've been flipping through xlwt and can't find anything. Can anyone suggest a way to accomplish this?
To actually insert a PDF, you may need to just use Excel. The most convenient way to automate a running instance of Excel is probably VBA or VBScript, but you can still use Python with pywin32 or pywinauto.
If it's important to stick with Python and it's acceptable to generate .xlsx
instead of .xls
, your best bet is XlsxWriter, which lets you import JPEG or PNG (in addition to BMP). Here's documentation and an example for inserting images with XlsxWriter.
这篇关于将PDF插入Excel,Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!