在 Jython 中将 Excel 转换为 Pdf

Aspose.Cells - Excel 转 Pdf 转换

使用Aspose.Cells Java for Jython进行附加文档。这里可以看到示例代码。

Jython 代码

 from aspose-cells import Settings

from com.aspose.cells import Workbook

from com.aspose.cells import SaveFormat



class Excel2PdfConversion:

    def __init__(self):

        dataDir = Settings.dataDir + 'WorkingWithFiles/Excel2PdfConversion/'



        saveFormat = SaveFormat

        workbook = Workbook(dataDir + "Book1.xls")

        #Save the document in PDF format

        workbook.save(dataDir + "OutBook1.pdf", saveFormat.PDF)

        # Print message

        print "\n Excel to PDF conversion performed successfully."



if __name__ == '__main__':        

    Excel2PdfConversion()

下载运行代码

从以下任何社交编码网站下载Append Documents (Aspose.Cells)