当前位置: 首页>>代码示例>>Python>>正文


Python Presentation.getSlideSize方法代码示例

本文整理汇总了Python中com.aspose.slides.Presentation.getSlideSize方法的典型用法代码示例。如果您正苦于以下问题:Python Presentation.getSlideSize方法的具体用法?Python Presentation.getSlideSize怎么用?Python Presentation.getSlideSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.aspose.slides.Presentation的用法示例。


在下文中一共展示了Presentation.getSlideSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_thumbnail_custom_size

# 需要导入模块: from com.aspose.slides import Presentation [as 别名]
# 或者: from com.aspose.slides.Presentation import getSlideSize [as 别名]
    def create_thumbnail_custom_size(dataDir):
        
        # Instantiate Presentation class that represents the presentation file
        pres = Presentation(dataDir + 'demo.pptx')

        # Access the first slide
        slide = pres.getSlides().get_Item(0)

        # User defined dimension
        desired_x = 1200
        desired_y = 800

        # Getting scaled value  of X and Y
        scale_x = (1.0 / java_values(pres.getSlideSize().getSize().getWidth())) * desired_x
        scale_y = (1.0 / java_values(pres.getSlideSize().getSize().getHeight())) * desired_y

        # Create a full scale image
        image = slide.getThumbnail(scale_x, scale_y)

        # Save the image to disk in JPEG format

        imageIO = ImageIO()
        imageIO.write(image, "jpeg", File(dataDir + "ContentBG_tnail.jpg"))

        print "Created thumbnail with custom size, please check the output file.". PHP_EOL
开发者ID:Aspose,项目名称:Aspose.Slides-for-Java,代码行数:27,代码来源:Thumbnail.py

示例2: set_page_size_for_pdf

# 需要导入模块: from com.aspose.slides import Presentation [as 别名]
# 或者: from com.aspose.slides.Presentation import getSlideSize [as 别名]
    def set_page_size_for_pdf(dataDir):
        
        dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/SizeAndLayout/'    
        
        # Instantiate Presentation class that represents the presentation file
        pres = Presentation()

        # Set SlideSize.Type Property
        slideSizeType = SlideSizeType
        pres.getSlideSize().setType(slideSizeType.A4Paper)

        # Set different properties of PDF Options
        opts = PdfOptions()
        opts.setSufficientResolution(600)

        # Saving the presentation
        save_format = SaveFormat
        pres.save(dataDir + "Export.pdf", save_format.Pdf, opts)

        print "Set page size for pdf, please check the output file."
开发者ID:Aspose,项目名称:Aspose.Slides-for-Java,代码行数:22,代码来源:SizeAndLayout.py

示例3: set_size_and_type

# 需要导入模块: from com.aspose.slides import Presentation [as 别名]
# 或者: from com.aspose.slides.Presentation import getSlideSize [as 别名]
    def set_size_and_type(dataDir):
        
        dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/SizeAndLayout/'    
        
        # Instantiate Presentation class that represents the presentation file
        pres = Presentation(dataDir + 'demo.pptx')
        aux_pres = Presentation()

        slide = pres.getSlides().get_Item(0)

        # Set the slide size of generated presentations to that of source
        aux_pres.getSlideSize().setType(pres.getSlideSize().getType())
        aux_pres.getSlideSize().setSize(pres.getSlideSize().getSize())

        # Clone required slide
        aux_pres.getSlides().addClone(pres.getSlides().get_Item(0))
        aux_pres.getSlides().removeAt(0)

        # Saving the presentation
        save_format = SaveFormat
        pres.save(dataDir + "Slide_Size_Type.pptx", save_format.Pptx)

        print "Set slide size and type, please check the output file."
开发者ID:Aspose,项目名称:Aspose.Slides-for-Java,代码行数:25,代码来源:SizeAndLayout.py


注:本文中的com.aspose.slides.Presentation.getSlideSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。