本文整理汇总了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
示例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."
示例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."