Saturday, 15 August 2015

How to convert .xls file to pdf through python scripting -



How to convert .xls file to pdf through python scripting -

i have created .xls using xlwt module. want convert newly created xls file pdf. can please tell me how can through python scripting. using python 2.6 version.

there @ to the lowest degree 2 possibilities here: either read .xls in cells , generate pdf, or maybe want print .xls .pdf programme created .xls.

in first case might want consider writing .pdf straight (you have info create .xls in programme @ point). have grid class can written out in html format, or .xls' (usingxlwt),.xlsm(usingopenpyxl) , to.pdf(usingreportlab`).

you need utilize sec alternative if write formula , kind of stuff in .xls , want have calculated results in .pdf. in case utilize subprocess phone call microsoft excel or openoffice/libreoffice calc right commandline parameters printing/converting file pdf.

e.g. libreoffice 4.0 commandline be:

scalc --convert-to pdf yourfile.xls

which result in yourfile.pdf

python

No comments:

Post a Comment