If I want to export ppt as a thumbnail or PDF file, how can I achieve this?
Currently, I am getting a blank object when I try to add Map. Please check the images attached.
for ppt and pdf export:
presentation.save("sample.pptx",
slides.export.SaveFormat.PPTX,
)
# Instantiates the PdfOptions class
pdfOptions = slides.export.PdfOptions()
# Sets the Jpeg quality
pdfOptions.jpeg_quality = 70
# Sets the behavior for metafiles
pdfOptions.save_metafiles_as_png = True
pdfOptions.sufficient_resolution = 64
# Sets the text compression level
pdfOptions.text_compression = slides.export.PdfTextCompression.FLATE
# Defines the PDF standard
pdfOptions.compliance = slides.export.PdfCompliance.PDF15
presentation.save("sample.pdf",
slides.export.SaveFormat.PDF,
pdfOptions,
)
For thumbnail export:
scale_x = (1.0 / ppt.slide_size.size.width) * 1024
scale_y = (1.0 / ppt.slide_size.size.height) * 576
with slide.get_thumbnail(scale_x, scale_y) as bmp:
bmp.save("img.png", draw.imaging.ImageFormat.png)
return file_name
Screenshot from 2023-01-26 20-54-25.png (120.6 KB)
Screenshot from 2023-01-26 20-54-13.png (55.5 KB)
Screenshot from 2023-01-26 20-53-52.png (91.7 KB)
@anantutkpd,
Thank you for describing the issue.
Your code snippets for converting the PowerPoint presentation to a PDF document and image look correct. Please share the sample.pptx file. Then we will check the problem on our end.
This is the sample pptx file with the map we are trying to clone to another pptx file.
Requirements:
- Clone map shape to another presentation slide.
- Generate a thumbnail of the slide with map shown in it.
- Generate a PDF of the presentation with map loaded
sample_map.zip (849.5 KB)
@anantutkpd,
Thank you for the sample presentation. We will check the problem and get back to you ASAP.
@anantutkpd,
I’ve reproduced the problem with missing the Map chart from the exported PDF document and PNG image after cloning it.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): SLIDESPYNET-76
You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.
The issues you found earlier (filed as SLIDESPYNET-76) have been fixed in Aspose.Slides for Python 23.4 (Windows, Linux, macOS).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page or PyPI.
@anantutkpd,
Please also note that you need to set the slide size for the target presentation to avoid shape misplacing.
...
map_chart = presentation1.slides[0].shapes[0]
presentation2.slide_size.set_size(presentation1.slide_size.type, slides.SlideSizeScaleType.DO_NOT_SCALE)
presentation2.slides[0].shapes.add_clone(map_chart)
...