在 Jython 中将 Excel 转换为 Pdf

Aspose.Cells - Excel 到 Pdf 的转换

使用附加文档Aspose.Cells Java 对于 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()

下载运行代码

下载**附加文件 (Aspose.Cells)**来自以下任何社交编码网站: