{"@attributes":{"version":"2.0"},"channel":{"title":"Documentation \u2013 Manage Presentations in Python","link":"https:\/\/docs.aspose.com\/slides\/python-net\/manage-presentation\/","description":"Recent content in Manage Presentations in Python on Documentation","generator":"Hugo -- gohugo.io","language":"en","item":[{"title":"Python-Net: Create Presentations in Python","link":"https:\/\/docs.aspose.com\/slides\/python-net\/create-presentation\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/docs.aspose.com\/slides\/python-net\/create-presentation\/","description":"\n        \n        \n        <h2 id=\"overview\"><strong>Overview<\/strong><\/h2>\n<p>Aspose.Slides for Python lets you build a brand\u2011new presentation file entirely in code. This article shows the core workflow\u2014creating a <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> object, grabbing the first slide, injecting a simple shape, and persisting the result\u2014so you can see how little setup is required to generate a presentation without Microsoft Office. Because the same API writes PPT, PPTX, and ODP files, you can target both traditional PowerPoint and OpenDocument formats from a single code base. Aspose.Slides is suited to desktop, web, or server environments, giving your Python application an efficient starting point for adding richer content such as text, images, or charts once the initial slide deck is in place.<\/p>\n<h2 id=\"create-a-presentation\"><strong>Create a Presentation<\/strong><\/h2>\n<p>Creating a PowerPoint file from scratch in Aspose.Slides for Python is as direct as instantiating the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> class. The constructor automatically supplies a blank deck with a single slide, giving you an immediate canvas for shapes, text, charts, or any other content your application needs. Once you modify that slide\u2014or add new ones\u2014you can persist the result to PPTX, legacy PPT, or even OpenDocument formats. The short code sample below illustrates this workflow by adding a simple shape onto the first slide.<\/p>\n<ol>\n<li>Create an instance of the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> class.<\/li>\n<li>Get a reference to the slide by its index.<\/li>\n<li>Add an <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/autoshape\/\">AutoShape<\/a> object of <code>CLOUD<\/code> type using the <code>add_auto_shape<\/code> method exposed by the <code>shapes<\/code> collection.<\/li>\n<li>Add text to the auto-shape.<\/li>\n<li>Save the modified presentation as a PPTX file.<\/li>\n<\/ol>\n<p>In the example below, a cloud shape is added to the first slide of the presentation.<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"c1\"># Instantiate the Presentation class that represents a presentation file.<\/span>\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">()<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    <span class=\"c1\"># Get the first slide.<\/span>\n    <span class=\"n\">slide<\/span> <span class=\"o\">=<\/span> <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"p\">[<\/span><span class=\"mi\">0<\/span><span class=\"p\">]<\/span>\n\n    <span class=\"c1\"># Add an auto-shape of type CLOUD.<\/span>\n    <span class=\"n\">auto_shape<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slide<\/span><span class=\"o\">.<\/span><span class=\"n\">shapes<\/span><span class=\"o\">.<\/span><span class=\"n\">add_auto_shape<\/span><span class=\"p\">(<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">ShapeType<\/span><span class=\"o\">.<\/span><span class=\"n\">CLOUD<\/span><span class=\"p\">,<\/span> <span class=\"mi\">20<\/span><span class=\"p\">,<\/span> <span class=\"mi\">20<\/span><span class=\"p\">,<\/span> <span class=\"mi\">200<\/span><span class=\"p\">,<\/span> <span class=\"mi\">80<\/span><span class=\"p\">)<\/span>\n    <span class=\"n\">auto_shape<\/span><span class=\"o\">.<\/span><span class=\"n\">text_frame<\/span><span class=\"o\">.<\/span><span class=\"n\">text<\/span> <span class=\"o\">=<\/span> <span class=\"s2\">&#34;Hello, Aspose!&#34;<\/span>\n\n    <span class=\"c1\"># Save the presentation as a PPTX file.<\/span>\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;new_presentation.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><p>The result:<\/p>\n<p><img src=\"new_presentation.png\" alt=\"The new presentation\"><\/p>\n<h2 id=\"faq\"><strong>FAQ<\/strong><\/h2>\n<p><strong>What formats can I save a new presentation to?<\/strong><\/p>\n<p>You can save to <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/save-presentation\/\">PPTX, PPT, and ODP<\/a>, and export to <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/convert-powerpoint-to-pdf\/\">PDF<\/a>, <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/convert-powerpoint-to-xps\/\">XPS<\/a>, <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/convert-powerpoint-to-html\/\">HTML<\/a>, <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/convert-powerpoint-to-png\/\">SVG<\/a>, and <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/convert-powerpoint-to-png\/\">images<\/a>, among others.<\/p>\n<p><strong>Can I start from a template (POTX\/POTM) and save as a regular PPTX?<\/strong><\/p>\n<p>Yes. Load the template and save to the desired format; POTX\/POTM\/PPTM and similar formats <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/supported-file-formats\/\">are supported<\/a>.<\/p>\n<p><strong>How do I control slide size\/aspect ratio when creating a presentation?<\/strong><\/p>\n<p>Set the <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/slide-size\/\">slide size<\/a> (including presets like 4:3 and 16:9 or custom dimensions) and choose how content should scale.<\/p>\n<p><strong>In what units are sizes and coordinates measured?<\/strong><\/p>\n<p>In points: 1 inch equals 72 units.<\/p>\n<p><strong>How do I handle very large presentations (with many media files) to reduce memory usage?<\/strong><\/p>\n<p>Use <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/manage-blob\/\">BLOB management strategies<\/a>, limit in-memory storage by leveraging temporary files, and prefer file-based workflows over purely in-memory streams.<\/p>\n<p><strong>Can I create\/save presentations in parallel?<\/strong><\/p>\n<p>You cannot operate on the same <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> instance from <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/multithreading\/\">multiple threads<\/a>. Run separate, isolated instances per thread or process.<\/p>\n<p><strong>How do I remove the trial watermark and limitations?<\/strong><\/p>\n<p><a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/licensing\/\">Apply a license<\/a> once per process. The license XML must remain unmodified, and the license setup should be synchronized if multiple threads are involved.<\/p>\n<p><strong>Can I digitally sign the PPTX I create?<\/strong><\/p>\n<p>Yes. <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/digital-signature-in-powerpoint\/\">Digital signatures<\/a> (adding and verifying) are supported for presentations.<\/p>\n<p><strong>Are macros (VBA) supported in created presentations?<\/strong><\/p>\n<p>Yes. You can <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/presentation-via-vba\/\">create\/edit VBA projects<\/a> and save macro-enabled files such as PPTM\/PPSM.<\/p>\n\n      "},{"title":"Python-Net: Open Presentations in Python","link":"https:\/\/docs.aspose.com\/slides\/python-net\/open-presentation\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/docs.aspose.com\/slides\/python-net\/open-presentation\/","description":"\n        \n        \n        <h2 id=\"overview\"><strong>Overview<\/strong><\/h2>\n<p>Beyond creating PowerPoint presentations from scratch, Aspose.Slides also lets you open existing presentations. After loading a presentation, you can retrieve information about it, edit slide content, add new slides, remove existing ones, and more.<\/p>\n<h2 id=\"open-presentations\"><strong>Open Presentations<\/strong><\/h2>\n<p>To open an existing presentation, instantiate the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> class and pass the file path to its constructor.<\/p>\n<p>The following Python example shows how to open a presentation and get its slide count:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-python\" data-lang=\"python\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"c1\"># Instantiate the Presentation class and pass a file path to its constructor.<\/span>\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;sample.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    <span class=\"c1\"># Print the total number of slides in the presentation.<\/span>\n    <span class=\"k\">print<\/span><span class=\"p\">(<\/span><span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">length<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"open-password-protected-presentations\"><strong>Open Password-Protected Presentations<\/strong><\/h2>\n<p>When you need to open a password-protected presentation, pass the password through the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/loadoptions\/password\/\">password<\/a> property of the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/loadoptions\/\">LoadOptions<\/a> class to decrypt and load it. The following Python code demonstrates this operation:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-python\" data-lang=\"python\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"n\">load_options<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">LoadOptions<\/span><span class=\"p\">()<\/span>\n<span class=\"n\">load_options<\/span><span class=\"o\">.<\/span><span class=\"n\">password<\/span> <span class=\"o\">=<\/span> <span class=\"s2\">&#34;YOUR_PASSWORD&#34;<\/span>\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;sample.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">load_options<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    <span class=\"c1\"># Perform operations on the decrypted presentation.<\/span>\n<\/code><\/pre><\/div><h2 id=\"open-large-presentations\"><strong>Open Large Presentations<\/strong><\/h2>\n<p>Aspose.Slides provides options\u2014particularly the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/loadoptions\/blob_management_options\/\">blob_management_options<\/a> property in the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/loadoptions\/\">LoadOptions<\/a> class\u2014to help you load large presentations.<\/p>\n<p>This Python code demonstrates loading a large presentation (for example, 2 GB):<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-python\" data-lang=\"python\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n<span class=\"kn\">import<\/span> <span class=\"nn\">os<\/span>\n\n<span class=\"n\">file_path<\/span> <span class=\"o\">=<\/span> <span class=\"s2\">&#34;LargePresentation.pptx&#34;<\/span>\n\n<span class=\"n\">load_options<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">LoadOptions<\/span><span class=\"p\">()<\/span>\n<span class=\"c1\"># Choose the KeepLocked behavior\u2014the presentation file will remain locked for the lifetime of <\/span>\n<span class=\"c1\"># the Presentation instance, but it does not need to be loaded into memory or copied to a temporary file.<\/span>\n<span class=\"n\">load_options<\/span><span class=\"o\">.<\/span><span class=\"n\">blob_management_options<\/span><span class=\"o\">.<\/span><span class=\"n\">presentation_locking_behavior<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">PresentationLockingBehavior<\/span><span class=\"o\">.<\/span><span class=\"n\">KEEP_LOCKED<\/span>\n<span class=\"n\">load_options<\/span><span class=\"o\">.<\/span><span class=\"n\">blob_management_options<\/span><span class=\"o\">.<\/span><span class=\"n\">is_temporary_files_allowed<\/span> <span class=\"o\">=<\/span> <span class=\"bp\">True<\/span>\n<span class=\"n\">load_options<\/span><span class=\"o\">.<\/span><span class=\"n\">blob_management_options<\/span><span class=\"o\">.<\/span><span class=\"n\">max_blobs_bytes_in_memory<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">10<\/span> <span class=\"o\">*<\/span> <span class=\"mi\">1024<\/span> <span class=\"o\">*<\/span> <span class=\"mi\">1024<\/span>  <span class=\"c1\"># 10 MB<\/span>\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"n\">file_path<\/span><span class=\"p\">,<\/span> <span class=\"n\">load_options<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    <span class=\"c1\"># The large presentation has been loaded and can be used, while memory consumption remains low.<\/span>\n\n    <span class=\"c1\"># Make changes to the presentation.<\/span>\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"p\">[<\/span><span class=\"mi\">0<\/span><span class=\"p\">]<\/span><span class=\"o\">.<\/span><span class=\"n\">name<\/span> <span class=\"o\">=<\/span> <span class=\"s2\">&#34;Large presentation&#34;<\/span>\n\n    <span class=\"c1\"># Save the presentation to another file. Memory consumption remains low during this operation.<\/span>\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;LargePresentation-copy.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n\n    <span class=\"c1\"># Don&#39;t do this! An I\/O exception will be thrown because the file is locked until the presentation object is disposed.<\/span>\n    <span class=\"n\">os<\/span><span class=\"o\">.<\/span><span class=\"n\">remove<\/span><span class=\"p\">(<\/span><span class=\"n\">file_path<\/span><span class=\"p\">)<\/span>\n\n<span class=\"c1\"># It is OK to do it here. The source file is no longer locked by the presentation object.<\/span>\n<span class=\"n\">os<\/span><span class=\"o\">.<\/span><span class=\"n\">remove<\/span><span class=\"p\">(<\/span><span class=\"n\">file_path<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div>\n\n<div class=\"alert alert-info\" role=\"alert\">\n<h4 class=\"alert-heading\">Info<\/h4>\n<p>To work around certain limitations when working with streams, Aspose.Slides may copy a stream\u2019s contents. Loading a large presentation from a stream causes the presentation to be copied and can slow loading. Therefore, when you need to load a large presentation, we strongly recommend using the presentation file path rather than a stream.<\/p>\n<p>When creating a presentation that contains large objects (video, audio, high-resolution images, etc.), you can use <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/manage-blob\/\">BLOB management<\/a> to reduce memory consumption.<\/p>\n\n<\/div>\n\n<h2 id=\"control-external-resources\"><strong>Control External Resources<\/strong><\/h2>\n<p>Aspose.Slides provides the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/iresourceloadingcallback\/\">IResourceLoadingCallback<\/a> class that lets you manage external resources. The following Python code shows how to use the <code>IResourceLoadingCallback<\/code> class:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-python\" data-lang=\"python\"><span class=\"c1\"># [TODO[not_supported_yet]: python implementation of .NET interfaces]<\/span>\n<\/code><\/pre><\/div><h2 id=\"load-presentations-without-embedded-binary-objects\"><strong>Load Presentations Without Embedded Binary Objects<\/strong><\/h2>\n<p>A PowerPoint presentation can contain the following types of embedded binary objects:<\/p>\n<ul>\n<li>VBA project (accessible via <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/vba_project\/\">Presentation.vba_project<\/a>);<\/li>\n<li>OLE object embedded data (accessible via <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/ioleembeddeddatainfo\/embedded_file_data\/\">OleEmbeddedDataInfo.embedded_file_data<\/a>);<\/li>\n<li>ActiveX control binary data (accessible via <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/control\/active_x_control_binary\/\">Control.active_x_control_binary<\/a>).<\/li>\n<\/ul>\n<p>Using the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/loadoptions\/delete_embedded_binary_objects\/\">LoadOptions.delete_embedded_binary_objects<\/a> property, you can load a presentation without any embedded binary objects.<\/p>\n<p>This property is useful for removing potentially malicious binary content. The following Python code demonstrates how to load a presentation without any embedded binary content:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"n\">load_options<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">LoadOptions<\/span><span class=\"p\">()<\/span>\n<span class=\"n\">load_options<\/span><span class=\"o\">.<\/span><span class=\"n\">delete_embedded_binary_objects<\/span> <span class=\"o\">=<\/span> <span class=\"bp\">True<\/span>\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;malware.ppt&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">load_options<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    <span class=\"c1\"># Perform operations on the presentation.<\/span>\n<\/code><\/pre><\/div><h2 id=\"faq\"><strong>FAQ<\/strong><\/h2>\n<p><strong>How can I tell that a file is corrupted and can\u2019t be opened?<\/strong><\/p>\n<p>You\u2019ll get a parsing\/format validation exception during load. Such errors often mention an invalid ZIP structure or broken PowerPoint records.<\/p>\n<p><strong>What happens if required fonts are missing when opening?<\/strong><\/p>\n<p>The file will open, but later <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/convert-presentation\/\">rendering\/export<\/a> may substitute fonts. <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/font-substitution\/\">Configure font substitutions<\/a> or <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/custom-font\/\">add the required fonts<\/a> to the runtime environment.<\/p>\n<p><strong>What about embedded media (video\/audio) when opening?<\/strong><\/p>\n<p>They become available as presentation resources. If media are referenced via external paths, ensure those paths are accessible in your environment; otherwise <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/convert-presentation\/\">rendering\/export<\/a> may omit the media.<\/p>\n\n      "},{"title":"Python-Net: Retrieve and Update Presentation Information in Python","link":"https:\/\/docs.aspose.com\/slides\/python-net\/examine-presentation\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/docs.aspose.com\/slides\/python-net\/examine-presentation\/","description":"\n        \n        \n        <p>Aspose.Slides for Python via .NET allows you to examine a presentation to find out its properties and understand its behavior.<\/p>\n\n\n<div class=\"alert alert-info\" role=\"alert\">\n<h4 class=\"alert-heading\">Info<\/h4>\nThe <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentationinfo\/\">PresentationInfo<\/a> and <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/documentproperties\/\">DocumentProperties<\/a> classes contain the properties and methods used in operations here.\n<\/div>\n\n<h2 id=\"check-a-presentation-format\"><strong>Check a Presentation Format<\/strong><\/h2>\n<p>Before working on a presentation, you may want to find out what format (PPT, PPTX, ODP, and others) the presentation is in at the moment.<\/p>\n<p>You can check a presentation&rsquo;s format without loading the presentation. See this Python code:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"n\">info1<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">PresentationFactory<\/span><span class=\"o\">.<\/span><span class=\"n\">instance<\/span><span class=\"o\">.<\/span><span class=\"n\">get_presentation_info<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;pres.pptx&#34;<\/span><span class=\"p\">)<\/span>\n<span class=\"k\">print<\/span><span class=\"p\">(<\/span><span class=\"n\">info1<\/span><span class=\"o\">.<\/span><span class=\"n\">load_format<\/span><span class=\"p\">,<\/span> <span class=\"n\">info1<\/span><span class=\"o\">.<\/span><span class=\"n\">load_format<\/span> <span class=\"o\">==<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">LoadFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n\n<span class=\"n\">info2<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">PresentationFactory<\/span><span class=\"o\">.<\/span><span class=\"n\">instance<\/span><span class=\"o\">.<\/span><span class=\"n\">get_presentation_info<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;pres.odp&#34;<\/span><span class=\"p\">)<\/span>\n<span class=\"k\">print<\/span><span class=\"p\">(<\/span><span class=\"n\">info2<\/span><span class=\"o\">.<\/span><span class=\"n\">load_format<\/span><span class=\"p\">,<\/span> <span class=\"n\">info2<\/span><span class=\"o\">.<\/span><span class=\"n\">load_format<\/span> <span class=\"o\">==<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">LoadFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">ODP<\/span><span class=\"p\">)<\/span>\n\n<span class=\"n\">info3<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">PresentationFactory<\/span><span class=\"o\">.<\/span><span class=\"n\">instance<\/span><span class=\"o\">.<\/span><span class=\"n\">get_presentation_info<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;pres.ppt&#34;<\/span><span class=\"p\">)<\/span>\n<span class=\"k\">print<\/span><span class=\"p\">(<\/span><span class=\"n\">info3<\/span><span class=\"o\">.<\/span><span class=\"n\">load_format<\/span><span class=\"p\">,<\/span> <span class=\"n\">info3<\/span><span class=\"o\">.<\/span><span class=\"n\">load_format<\/span> <span class=\"o\">==<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">LoadFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPT<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"get-presentation-properties\"><strong>Get Presentation Properties<\/strong><\/h2>\n<p>This Python code shows you how to get presentation properties (information about the presentation):<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"n\">info<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">PresentationFactory<\/span><span class=\"o\">.<\/span><span class=\"n\">instance<\/span><span class=\"o\">.<\/span><span class=\"n\">get_presentation_info<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;pres.pptx&#34;<\/span><span class=\"p\">)<\/span>\n<span class=\"n\">props<\/span> <span class=\"o\">=<\/span> <span class=\"n\">info<\/span><span class=\"o\">.<\/span><span class=\"n\">read_document_properties<\/span><span class=\"p\">()<\/span>\n<span class=\"k\">print<\/span><span class=\"p\">(<\/span><span class=\"n\">props<\/span><span class=\"o\">.<\/span><span class=\"n\">created_time<\/span><span class=\"p\">)<\/span>\n<span class=\"k\">print<\/span><span class=\"p\">(<\/span><span class=\"n\">props<\/span><span class=\"o\">.<\/span><span class=\"n\">subject<\/span><span class=\"p\">)<\/span>\n<span class=\"k\">print<\/span><span class=\"p\">(<\/span><span class=\"n\">props<\/span><span class=\"o\">.<\/span><span class=\"n\">title<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><p>You may want to see the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/documentproperties\/#properties\">properties under the DocumentProperties<\/a> class.<\/p>\n<h2 id=\"update-presentation-properties\"><strong>Update Presentation Properties<\/strong><\/h2>\n<p>Aspose.Slides provides the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentationinfo\/update_document_properties\/#idocumentproperties\">PresentationInfo.update_document_properties<\/a> method that allows you to make changes to presentation properties.<\/p>\n<p>Let&rsquo;s say we have a PowerPoint presentation with the document properties shown below.<\/p>\n<p><img src=\"input_properties.png\" alt=\"Original document properties of the PowerPoint presentation\"><\/p>\n<p>This code example shows you how to edit some presentation properties:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"n\">file_name<\/span> <span class=\"o\">=<\/span> <span class=\"s2\">&#34;sample.pptx&#34;<\/span>\n\n<span class=\"n\">info<\/span> <span class=\"o\">=<\/span> <span class=\"n\">PresentationFactory<\/span><span class=\"o\">.<\/span><span class=\"n\">instance<\/span><span class=\"o\">.<\/span><span class=\"n\">get_presentation_info<\/span><span class=\"p\">(<\/span><span class=\"n\">file_name<\/span><span class=\"p\">)<\/span>\n\n<span class=\"n\">properties<\/span> <span class=\"o\">=<\/span> <span class=\"n\">info<\/span><span class=\"o\">.<\/span><span class=\"n\">read_document_properties<\/span><span class=\"p\">()<\/span>\n<span class=\"n\">properties<\/span><span class=\"o\">.<\/span><span class=\"n\">title<\/span> <span class=\"o\">=<\/span> <span class=\"s2\">&#34;My title&#34;<\/span>\n<span class=\"n\">properties<\/span><span class=\"o\">.<\/span><span class=\"n\">last_saved_time<\/span> <span class=\"o\">=<\/span> <span class=\"n\">datetime<\/span><span class=\"o\">.<\/span><span class=\"n\">now<\/span><span class=\"p\">()<\/span>\n\n<span class=\"n\">info<\/span><span class=\"o\">.<\/span><span class=\"n\">update_document_properties<\/span><span class=\"p\">(<\/span><span class=\"n\">properties<\/span><span class=\"p\">)<\/span>\n<span class=\"n\">info<\/span><span class=\"o\">.<\/span><span class=\"n\">write_binded_presentation<\/span><span class=\"p\">(<\/span><span class=\"n\">file_name<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><p>The results of changing the document properties are shown below.<\/p>\n<p><img src=\"output_properties.png\" alt=\"Changed document properties of the PowerPoint presentation\"><\/p>\n<h2 id=\"useful-links\"><strong>Useful Links<\/strong><\/h2>\n<p>To get more information about a presentation and its security attributes, you may find these links useful:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.aspose.com\/slides\/python-net\/password-protected-presentation\/#checking-whether-a-presentation-is-encrypted\">Checking whether a Presentation is Encrypted<\/a><\/li>\n<li><a href=\"https:\/\/docs.aspose.com\/slides\/python-net\/password-protected-presentation\/#checking-whether-a-presentation-is-write-protected\">Checking whether a Presentation is Write Protected (read-only)<\/a><\/li>\n<li><a href=\"https:\/\/docs.aspose.com\/slides\/python-net\/password-protected-presentation\/#checking-whether-a-presentation-is-password-protected-before-loading-it\">Checking whether a Presentation is Password Protected Before Loading it<\/a><\/li>\n<li><a href=\"https:\/\/docs.aspose.com\/slides\/python-net\/password-protected-presentation\/#validating-or-confirming-that-a-specific-password-has-been-used-to-protect-a-presentation\">Confirming the Password Used to Protect a Presentation<\/a>.<\/li>\n<\/ul>\n<h2 id=\"faq\"><strong>FAQ<\/strong><\/h2>\n<p><strong>How can I check whether fonts are embedded and which ones they are?<\/strong><\/p>\n<p>Look for <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/fontsmanager\/get_embedded_fonts\/\">embedded-font information<\/a> at the presentation level, then compare those entries with the set of <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/fontsmanager\/get_fonts\/\">fonts actually used across content<\/a> to identify which fonts are critical for rendering.<\/p>\n<p><strong>How can I quickly tell if the file has hidden slides and how many?<\/strong><\/p>\n<p>Iterate through the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/slidecollection\/\">slide collection<\/a> and inspect each slide&rsquo;s <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/slide\/hidden\/\">visibility flag<\/a>.<\/p>\n<p><strong>Can I detect whether custom slide size and orientation are used, and whether they differ from the defaults?<\/strong><\/p>\n<p>Yes. Compare the current <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/slide_size\/\">slide size<\/a> and orientation with the standard presets; this helps anticipate behavior for printing and export.<\/p>\n<p><strong>Is there a quick way to see if charts reference external data sources?<\/strong><\/p>\n<p>Yes. Traverse all <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.charts\/chart\/\">charts<\/a>, check their <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.charts\/chartdata\/data_source_type\/\">data source<\/a>, and note whether the data is internal or link-based, including any broken links.<\/p>\n<p><strong>How can I assess &lsquo;heavy&rsquo; slides that may slow rendering or PDF export?<\/strong><\/p>\n<p>For each slide, tally object counts and look for large images, transparency, shadows, animations, and multimedia; assign a rough complexity score to flag potential performance hotspots.<\/p>\n\n      "},{"title":"Python-Net: Efficiently Merge Presentations with Python","link":"https:\/\/docs.aspose.com\/slides\/python-net\/merge-presentation\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/docs.aspose.com\/slides\/python-net\/merge-presentation\/","description":"\n        \n        \n        <h2 id=\"optimize-your-presentation-merging\"><strong>Optimize Your Presentation Merging<\/strong><\/h2>\n<p>With <a href=\"https:\/\/products.aspose.com\/slides\/python-net\/\">Aspose.Slides for Python<\/a>, you can seamlessly combine PowerPoint presentations while preserving styles, layouts, and all elements. Unlike other tools, Aspose.Slides merges presentations without compromising quality or losing data. Merge entire decks, specific slides, or even different file formats (e.g., PPT to PPTX).<\/p>\n<h3 id=\"merging-features\"><strong>Merging Features<\/strong><\/h3>\n<ul>\n<li><strong>Full Presentation Merge:<\/strong> Assemble all slides into a single file.<\/li>\n<li><strong>Specific Slide Merge:<\/strong> Choose and combine selected slides.<\/li>\n<li><strong>Cross-Format Merge:<\/strong> Integrate presentations of varying formats, maintaining integrity.<\/li>\n<\/ul>\n<h2 id=\"presentation-merging\"><strong>Presentation Merging<\/strong><\/h2>\n<p>When you merge one presentation into another, you are effectively combining their slides into a single presentation to produce one file. Most presentation programs\u2014such as PowerPoint or OpenOffice\u2014do not provide features that let you merge presentations in this way.<\/p>\n<p>However, <a href=\"https:\/\/products.aspose.com\/slides\/python-net\/\">Aspose.Slides for Python<\/a> allows you to merge presentations in several ways. You can merge presentations with all their shapes, styles, text, formatting, comments, and animations, without any loss of quality or data.<\/p>\n<p><strong>See also<\/strong><\/p>\n<p><a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/clone-slides\/\">Clone PowerPoint Slides in Python<\/a><\/p>\n<h3 id=\"what-can-be-merged\"><strong>What Can Be Merged<\/strong><\/h3>\n<p>With Aspose.Slides, you can merge:<\/p>\n<ul>\n<li>Entire presentations: all slides from the source decks are combined into a single presentation.<\/li>\n<li>Specific slides: only the selected slides are combined into a single presentation.<\/li>\n<li>Presentations of the same format (e.g., PPT\u2192PPT, PPTX\u2192PPTX) or across different formats (e.g., PPT\u2192PPTX, PPTX\u2192ODP).<\/li>\n<\/ul>\n<h3 id=\"merging-options\"><strong>Merging Options<\/strong><\/h3>\n<p>You can control whether:<\/p>\n<ul>\n<li>Each slide in the output presentation retains its original style, or<\/li>\n<li>A single style is applied to all slides in the output presentation.<\/li>\n<\/ul>\n<p>To merge presentations, Aspose.Slides provides the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/slidecollection\/add_clone\/\">add_clone<\/a> methods on the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/slidecollection\/\">SlideCollection<\/a> class. These method overloads define how the merge is performed. Every <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> object exposes a <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/slides\/\">slides<\/a> collection, so you call <code>add_clone<\/code> on the destination presentation\u2019s slide collection.<\/p>\n<p>The <code>add_clone<\/code> method returns an <code>Slide<\/code>\u2014a clone of the source slide. Slides in the output presentation are copies of the originals, so you can modify the resulting slides (for example, apply styles, formatting, or layouts) without affecting the source presentations.<\/p>\n<h2 id=\"merge-presentations\"><strong>Merge Presentations<\/strong><\/h2>\n<p>Aspose.Slides provides the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/slidecollection\/add_clone\/#asposeslidesislide\">add_clone(ISlide)<\/a> method, which allows you to combine slides while preserving their layouts and styles (using default parameters).<\/p>\n<p>The following Python example shows how to merge presentations:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;presentation1.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation1<\/span><span class=\"p\">:<\/span>\n    <span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;presentation2.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation2<\/span><span class=\"p\">:<\/span>\n        <span class=\"k\">for<\/span> <span class=\"n\">slide<\/span> <span class=\"ow\">in<\/span> <span class=\"n\">presentation2<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"p\">:<\/span>\n            <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">add_clone<\/span><span class=\"p\">(<\/span><span class=\"n\">slide<\/span><span class=\"p\">)<\/span>\n        <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;combined.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"merge-presentations-with-a-slide-master\"><strong>Merge Presentations with a Slide Master<\/strong><\/h2>\n<p>Aspose.Slides provides the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/slidecollection\/add_clone\/#asposeslidesislide-asposeslidesimasterslide-bool\">add_clone(ISlide, IMasterSlide, Boolean)<\/a> method, which allows you to merge slides while applying a slide master from a template. This way, when needed, you can restyle the slides in the output presentation.<\/p>\n<p>The following Python example demonstrates this operation:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;presentation1.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation1<\/span><span class=\"p\">:<\/span>\n    <span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;presentation2.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation2<\/span><span class=\"p\">:<\/span>\n        <span class=\"k\">for<\/span> <span class=\"n\">slide<\/span> <span class=\"ow\">in<\/span> <span class=\"n\">presentation2<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"p\">:<\/span>\n            <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">add_clone<\/span><span class=\"p\">(<\/span><span class=\"n\">slide<\/span><span class=\"p\">,<\/span> <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">masters<\/span><span class=\"p\">[<\/span><span class=\"mi\">0<\/span><span class=\"p\">],<\/span> <span class=\"bp\">True<\/span><span class=\"p\">)<\/span>\n        <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;combined_with_master.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span> \n<\/code><\/pre><\/div>\n\n<div class=\"alert alert-warning\" role=\"alert\">\n<h4 class=\"alert-heading\">Note<\/h4>\nThe appropriate layout under the specified slide master is determined automatically. If no suitable layout can be found and the <code>allow_clone_missing_layout<\/code> boolean parameter of the <code>add_clone<\/code> method is set to <code>True<\/code>, the source slide\u2019s layout is used instead. Otherwise, a <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/pptxeditexception\/\">PptxEditException<\/a> is thrown.\n<\/div>\n\n<p>To apply a different slide layout to slides in the output presentation, use the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/slidecollection\/add_clone\/#asposeslidesislide-asposeslidesilayoutslide\">add_clone(ISlide, ILayoutSlide)<\/a> method when merging.<\/p>\n<h2 id=\"merge-specific-slides-from-presentations\"><strong>Merge Specific Slides From Presentations<\/strong><\/h2>\n<p>Merging specific slides from multiple presentations is useful when creating custom slide decks. Aspose.Slides lets you select and import only the slides you need, while preserving the original slides\u2019 formatting, layout, and design.<\/p>\n<p>The following Python example creates a new presentation, adds title slides from two other presentations, and saves the result to a file:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"k\">def<\/span> <span class=\"nf\">get_title_slide<\/span><span class=\"p\">(<\/span><span class=\"n\">pres<\/span><span class=\"p\">):<\/span>\n    <span class=\"k\">for<\/span> <span class=\"n\">slide<\/span> <span class=\"ow\">in<\/span> <span class=\"n\">pres<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"p\">:<\/span>\n        <span class=\"k\">if<\/span> <span class=\"n\">slide<\/span><span class=\"o\">.<\/span><span class=\"n\">layout_slide<\/span><span class=\"o\">.<\/span><span class=\"n\">layout_type<\/span> <span class=\"o\">==<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">SlideLayoutType<\/span><span class=\"o\">.<\/span><span class=\"n\">TITLE<\/span><span class=\"p\">:<\/span>\n            <span class=\"k\">return<\/span> <span class=\"n\">slide<\/span>\n    <span class=\"k\">return<\/span> <span class=\"bp\">None<\/span>\n\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">()<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">,<\/span> \\\n        <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;presentation1.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation1<\/span><span class=\"p\">,<\/span> \\\n        <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;presentation2.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation2<\/span><span class=\"p\">:<\/span>\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">remove_at<\/span><span class=\"p\">(<\/span><span class=\"mi\">0<\/span><span class=\"p\">)<\/span>\n\n    <span class=\"n\">slide1<\/span> <span class=\"o\">=<\/span> <span class=\"n\">get_title_slide<\/span><span class=\"p\">(<\/span><span class=\"n\">presentation1<\/span><span class=\"p\">)<\/span>\n    <span class=\"k\">if<\/span> <span class=\"n\">slide1<\/span> <span class=\"ow\">is<\/span> <span class=\"ow\">not<\/span> <span class=\"bp\">None<\/span><span class=\"p\">:<\/span>\n        <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">add_clone<\/span><span class=\"p\">(<\/span><span class=\"n\">slide1<\/span><span class=\"p\">)<\/span>\n\n    <span class=\"n\">slide2<\/span> <span class=\"o\">=<\/span> <span class=\"n\">get_title_slide<\/span><span class=\"p\">(<\/span><span class=\"n\">presentation2<\/span><span class=\"p\">)<\/span>\n    <span class=\"k\">if<\/span> <span class=\"n\">slide2<\/span> <span class=\"ow\">is<\/span> <span class=\"ow\">not<\/span> <span class=\"bp\">None<\/span><span class=\"p\">:<\/span>\n        <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">add_clone<\/span><span class=\"p\">(<\/span><span class=\"n\">slide2<\/span><span class=\"p\">)<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;combined.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"merge-presentations-with-a-slide-layout\"><strong>Merge Presentations with a Slide Layout<\/strong><\/h2>\n<p>The following Python example shows how to merge slides from multiple presentations while applying a specific slide layout to produce a single output presentation:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;presentation1.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation1<\/span><span class=\"p\">:<\/span>\n    <span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;presentation2.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation2<\/span><span class=\"p\">:<\/span>\n        <span class=\"k\">for<\/span> <span class=\"n\">slide<\/span> <span class=\"ow\">in<\/span> <span class=\"n\">presentation2<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"p\">:<\/span>\n            <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">add_clone<\/span><span class=\"p\">(<\/span><span class=\"n\">slide<\/span><span class=\"p\">,<\/span> <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">layout_slides<\/span><span class=\"p\">[<\/span><span class=\"mi\">0<\/span><span class=\"p\">])<\/span>\n        <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;combined_with_layout.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span> \n<\/code><\/pre><\/div><h2 id=\"merge-presentations-with-different-slide-sizes\"><strong>Merge Presentations with Different Slide Sizes<\/strong><\/h2>\n\n\n<div class=\"alert alert-warning\" role=\"alert\">\n<h4 class=\"alert-heading\">Note<\/h4>\nYou cannot directly merge presentations that have different slide sizes.\n<\/div>\n\n<p>To merge two presentations with different slide sizes, first resize one presentation so its slide size matches the other\u2019s.<\/p>\n<p>The following sample code demonstrates this process:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;presentation1.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation1<\/span><span class=\"p\">:<\/span>\n    <span class=\"n\">slide_size<\/span> <span class=\"o\">=<\/span> <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">slide_size<\/span><span class=\"o\">.<\/span><span class=\"n\">size<\/span>\n    <span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;presentation2.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation2<\/span><span class=\"p\">:<\/span>\n        <span class=\"n\">presentation2<\/span><span class=\"o\">.<\/span><span class=\"n\">slide_size<\/span><span class=\"o\">.<\/span><span class=\"n\">set_size<\/span><span class=\"p\">(<\/span><span class=\"n\">slide_size<\/span><span class=\"o\">.<\/span><span class=\"n\">width<\/span><span class=\"p\">,<\/span> <span class=\"n\">slide_size<\/span><span class=\"o\">.<\/span><span class=\"n\">height<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">SlideSizeScaleType<\/span><span class=\"o\">.<\/span><span class=\"n\">ENSURE_FIT<\/span><span class=\"p\">)<\/span>\n        <span class=\"k\">for<\/span> <span class=\"n\">slide<\/span> <span class=\"ow\">in<\/span> <span class=\"n\">presentation2<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"p\">:<\/span>\n            <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">add_clone<\/span><span class=\"p\">(<\/span><span class=\"n\">slide<\/span><span class=\"p\">)<\/span>\n        <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;combined_size.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span> \n<\/code><\/pre><\/div><h2 id=\"merge-slides-into-a-presentation-section\"><strong>Merge Slides into a Presentation Section<\/strong><\/h2>\n<p>The following Python example shows how to merge a specific slide into a section of a presentation:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;presentation1.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation1<\/span><span class=\"p\">:<\/span>\n    <span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;presentation2.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation2<\/span><span class=\"p\">:<\/span>\n        <span class=\"k\">for<\/span> <span class=\"n\">slide<\/span> <span class=\"ow\">in<\/span> <span class=\"n\">presentation2<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"p\">:<\/span>\n            <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">add_clone<\/span><span class=\"p\">(<\/span><span class=\"n\">slide<\/span><span class=\"p\">,<\/span> <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">sections<\/span><span class=\"p\">[<\/span><span class=\"mi\">0<\/span><span class=\"p\">])<\/span>\n        <span class=\"n\">presentation1<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;combined_sections.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span> \n<\/code><\/pre><\/div><p>The slide is added at the end of the section.<\/p>\n\n\n<div class=\"alert alert-primary\" role=\"alert\">\n<h4 class=\"alert-heading\">Tip<\/h4>\n<p>Looking for a quick and <strong>free online tool<\/strong> to <strong>merge PowerPoint presentations<\/strong>? Try the <a href=\"https:\/\/products.aspose.app\/slides\/merger\"><strong>Aspose PowerPoint Merger<\/strong><\/a>.<\/p>\n<ul>\n<li><strong>Merge PowerPoint files easily<\/strong>: Combine multiple <strong>PPT, PPTX, ODP<\/strong> presentations into a single file.<\/li>\n<li><strong>Supports different formats<\/strong>: Merge <strong>PPT to PPTX<\/strong>, <strong>PPTX to ODP<\/strong>, and more.<\/li>\n<li><strong>No installation required<\/strong>: Works directly in your browser, fast and secure.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/products.aspose.app\/slides\/merger\"><img src=\"slides-merger.png\" alt=\"Merge PowerPoint Files Online\"><\/a><\/p>\n<p>Start merging your PowerPoint files with <strong>Aspose free online tool<\/strong> today!<\/p>\n\n<\/div>\n\n\n\n<div class=\"alert alert-primary\" role=\"alert\">\n<h4 class=\"alert-heading\">Tip<\/h4>\nAspose provides a <a href=\"https:\/\/products.aspose.app\/slides\/collage\">FREE Collage web app<\/a>. Using this online service, you can merge <a href=\"https:\/\/products.aspose.app\/slides\/collage\/jpg\">JPG to JPG<\/a> or PNG to PNG images, create <a href=\"https:\/\/products.aspose.app\/slides\/collage\/photo-grid\">photo grids<\/a>, and so on.\n<\/div>\n\n<h2 id=\"faq\"><strong>FAQ<\/strong><\/h2>\n<p><strong>Are speaker notes preserved during merge?<\/strong><\/p>\n<p>Yes. When cloning slides, Aspose.Slides carries over all slide elements, including notes, formatting, and animations.<\/p>\n<p><strong>Are comments and their authors transferred?<\/strong><\/p>\n<p>Comments, as part of slide content, are copied with the slide. Comment author labels are preserved as comment objects in the resulting presentation.<\/p>\n<p><strong>What if the source presentation is password-protected?<\/strong><\/p>\n<p>It must be <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/password-protected-presentation\/\">opened with the password<\/a> via <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/loadoptions\/password\/\">LoadOptions.password<\/a>; after loading, those slides can be safely cloned into an unprotected target file (or a protected one as well).<\/p>\n<p><strong>How thread-safe is the merge operation?<\/strong><\/p>\n<p>Do not use the same <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> instance from <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/multithreading\/\">multiple threads<\/a>. The recommended rule is &ldquo;one document \u2014 one thread&rdquo;; different files can be processed in parallel in separate threads.<\/p>\n\n      "},{"title":"Python-Net: Import Presentations with Python","link":"https:\/\/docs.aspose.com\/slides\/python-net\/import-presentation\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/docs.aspose.com\/slides\/python-net\/import-presentation\/","description":"\n        \n        \n        <h2 id=\"overview\"><strong>Overview<\/strong><\/h2>\n<p>With <a href=\"https:\/\/products.aspose.com\/slides\/python-net\/\"><strong>Aspose.Slides for Python via .NET<\/strong><\/a>, you can import content into a presentation from other file formats. The <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/slidecollection\/\">SlideCollection<\/a> class provides methods to import slides from PDF, HTML, and other sources.<\/p>\n<h2 id=\"convert-a-pdf-to-a-presentation\"><strong>Convert a PDF to a Presentation<\/strong><\/h2>\n<p>This section shows how to convert a PDF into a presentation using Aspose.Slides. It walks you through importing the PDF, turning its pages into slides, and saving the result as a PPTX file.<\/p>\n<p><img src=\"pdf-to-powerpoint.png\" alt=\"pdf-to-powerpoint\" style=\"zoom:50%;\" \/><\/p>\n<ol>\n<li>Create an instance of the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> class.<\/li>\n<li>Call the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/slidecollection\/add_from_pdf\/\">add_from_pdf<\/a> method and pass the PDF file.<\/li>\n<li>Use the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/save\/\">save<\/a> method to save the presentation in PowerPoint format.<\/li>\n<\/ol>\n<p>The following Python example demonstrates converting a PDF to a presentation:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">()<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">remove_at<\/span><span class=\"p\">(<\/span><span class=\"mi\">0<\/span><span class=\"p\">)<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">add_from_pdf<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;sample.pdf&#34;<\/span><span class=\"p\">)<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;output.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div>\n\n<div class=\"alert alert-primary\" role=\"alert\">\n<h4 class=\"alert-heading\">Tip<\/h4>\nYou may want to try <strong>Aspose\u2019s free<\/strong> <a href=\"https:\/\/products.aspose.app\/slides\/import\/pdf-to-powerpoint\">PDF to PowerPoint<\/a> web app\u2014it\u2019s a live implementation of the process described here.\n<\/div>\n\n<h2 id=\"convert-an-html-to-a-presentation\"><strong>Convert an HTML to a Presentation<\/strong><\/h2>\n<p>This section shows how to import HTML content into a presentation using Aspose.Slides. It covers loading the HTML, transforming it into slides with preserved text, images, and basic formatting, and saving the result as a PPTX file.<\/p>\n<ol>\n<li>Create an instance of the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> class.<\/li>\n<li>Call the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/slidecollection\/add_from_html\/\">add_from_html<\/a> method and pass the HTML file.<\/li>\n<li>Use the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/save\/\">save<\/a> method to save the presentation in PowerPoint format.<\/li>\n<\/ol>\n<p>The following Python example demonstrates converting an HTML to a presentation:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-python\" data-lang=\"python\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">()<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">remove_at<\/span><span class=\"p\">(<\/span><span class=\"mi\">0<\/span><span class=\"p\">)<\/span>\n\n    <span class=\"k\">with<\/span> <span class=\"nb\">open<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;page.html&#34;<\/span><span class=\"p\">,<\/span> <span class=\"s2\">&#34;rb&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">html_stream<\/span><span class=\"p\">:<\/span>\n        <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">add_from_html<\/span><span class=\"p\">(<\/span><span class=\"n\">html_stream<\/span><span class=\"p\">)<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;output.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"faq\"><strong>FAQ<\/strong><\/h2>\n<p><strong>Are tables preserved when importing a PDF, and can their detection be improved?<\/strong><\/p>\n<p>Tables can be detected during import; <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.importing\/pdfimportoptions\/\">PdfImportOptions<\/a> includes a <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.importing\/pdfimportoptions\/detect_tables\/\">detect_tables<\/a> parameter that enables table recognition. The effectiveness depends on the PDF\u2019s structure.<\/p>\n\n\n<div class=\"alert alert-info\" role=\"alert\">\n<h4 class=\"alert-heading\">Note<\/h4>\n<p>You can also use Aspose.Slides to convert HTML into other popular file formats:<\/p>\n<ul>\n<li><a href=\"https:\/\/products.aspose.com\/slides\/python-net\/conversion\/html-to-image\/\">HTML to image<\/a><\/li>\n<li><a href=\"https:\/\/products.aspose.com\/slides\/python-net\/conversion\/html-to-jpg\/\">HTML to JPG<\/a><\/li>\n<li><a href=\"https:\/\/products.aspose.com\/slides\/python-net\/conversion\/html-to-xml\/\">HTML to XML<\/a><\/li>\n<li><a href=\"https:\/\/products.aspose.com\/slides\/python-net\/conversion\/html-to-tiff\/\">HTML to TIFF<\/a><\/li>\n<\/ul>\n\n<\/div>\n\n\n      "},{"title":"Python-Net: Convert Presentations to Multiple Formats in Python","link":"https:\/\/docs.aspose.com\/slides\/python-net\/convert-presentation\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/docs.aspose.com\/slides\/python-net\/convert-presentation\/","description":"\n        \n        \n        <h2 id=\"introduction\"><strong>Introduction<\/strong><\/h2>\n<p>This page provides an overview of presentation conversion with Aspose.Slides for Python via .NET. It summarizes supported scenarios and points to focused guides that show the exact code for exporting presentations and slides to formats such as PDF, XPS, TIFF, as well as converting between PPT and PPTX. Where relevant, the linked articles highlight format-specific options\u2014for example, rendering notes or tuning image quality\u2014and known limitations such as partial support in PPT\u2192PPTX paths. Use this page to choose a target format and then follow the linked recipe.<\/p>\n<h2 id=\"ppt-to-pptx-conversion\"><strong>PPT to PPTX Conversion<\/strong><\/h2>\n<h3 id=\"about-pptpptx\"><strong>About PPT\/PPTX<\/strong><\/h3>\n<p>PPT is the older binary PowerPoint format (97\u20132003), while PPTX is the ZIP-packaged Open XML format introduced in PowerPoint 2007. Compared to PPT, PPTX typically produces smaller files, supports modern features, works well with document automation, and is recommended for long-term storage and cross-platform workflows.<\/p>\n<h3 id=\"convert-ppt-to-pptx\"><strong>Convert PPT to PPTX<\/strong><\/h3>\n<p>Aspose.Slides supports converting PPT presentations to the PPTX format. The key advantage of using the Aspose.Slides API for this task is the simplicity of the workflow needed to achieve the desired result. In practice, you can perform the conversion with minimal code while maintaining high fidelity of slides, layouts, and media.<\/p>\n\n\n<div class=\"alert alert-primary\" role=\"alert\">\n\nRead more:\u00a0<a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/convert-ppt-to-pptx\/\">Convert PPT to PPTX in Python<\/a>.\n<\/div>\n\n<h2 id=\"presentation-to-pdf-conversion\"><strong>Presentation to PDF Conversion<\/strong><\/h2>\n<h3 id=\"about-pdf\"><strong>About PDF<\/strong><\/h3>\n<p>The <a href=\"https:\/\/en.wikipedia.org\/wiki\/PDF\">Portable Document Format<\/a> (PDF) is a file format created by Adobe Systems for exchanging documents between organizations. Its purpose is to ensure that a document\u2019s contents are displayed with the same visual appearance regardless of the platform on which the document is viewed.<\/p>\n<h3 id=\"convert-presentations-to-pdf\"><strong>Convert Presentations to PDF<\/strong><\/h3>\n<p>Any presentation that can be loaded in Aspose.Slides can be converted to a PDF document. You can export presentations to PDF directly with the Aspose.Slides component; no third-party libraries or the Aspose.PDF component are required.<\/p>\n\n\n<div class=\"alert alert-primary\" role=\"alert\">\n\nRead more:\u00a0<a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/convert-powerpoint-to-pdf\/\">Convert PPT &amp; PPTX to PDF in Python<\/a>.\n<\/div>\n\n<h2 id=\"presentation-to-xps-conversion\"><strong>Presentation to XPS Conversion<\/strong><\/h2>\n<h3 id=\"about-xps\"><strong>About XPS<\/strong><\/h3>\n<p>The <a href=\"https:\/\/en.wikipedia.org\/wiki\/Open_XML_Paper_Specification\">XML Paper Specification<\/a> (XPS) is a page description language and fixed-document format originally developed by Microsoft. Like PDF, XPS is a fixed-layout document format designed to preserve document fidelity and provide a device-independent appearance.<\/p>\n<h3 id=\"convert-presentations-to-xps\"><strong>Convert Presentations to XPS<\/strong><\/h3>\n<p>Any presentation that can be loaded by Aspose.Slides can be converted to the XPS format. Aspose.Slides uses a high-fidelity page layout and rendering engine to produce output in the fixed-layout XPS format. Notably, Aspose.Slides generates XPS directly without relying on Windows Presentation Foundation (WPF).<\/p>\n\n\n<div class=\"alert alert-primary\" role=\"alert\">\n\nRead more:\u00a0<a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/convert-powerpoint-to-xps\/\">Convert PowerPoint Presentations to XPS in Python<\/a>.\n<\/div>\n\n<h2 id=\"presentation-to-tiff-conversion\"><strong>Presentation to TIFF Conversion<\/strong><\/h2>\n<h3 id=\"about-tiff\"><strong>About TIFF<\/strong><\/h3>\n<p>The <a href=\"https:\/\/en.wikipedia.org\/wiki\/TIFF\">Tagged Image File Format<\/a> (TIFF) is a raster image format known for storing multiple images (pages) in a single file. Originally developed by Aldus, it is widely supported by scanning, faxing, and other image-processing applications.<\/p>\n<h3 id=\"convert-presentations-to-tiff\"><strong>Convert Presentations to TIFF<\/strong><\/h3>\n<p>Any document that can be loaded in Aspose.Slides can also be converted directly to a TIFF file without any third-party components. You can also optionally specify the image size for the pages in the resulting TIFF.<\/p>\n\n\n<div class=\"alert alert-primary\" role=\"alert\">\n\nRead more:\u00a0<a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/convert-powerpoint-to-tiff\/\">Convert PowerPoint Presentations to TIFF in Python<\/a>.\n<\/div>\n\n<h2 id=\"faq\"><strong>FAQ<\/strong><\/h2>\n<p><strong>Can I include hidden slides when exporting to PDF\/XPS?<\/strong><\/p>\n<p>Yes. Export supports including hidden slides via the corresponding option in the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.export\/pdfoptions\/show_hidden_slides\/\">PDF<\/a>\/<a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.export\/xpsoptions\/show_hidden_slides\/\">XPS<\/a> settings.<\/p>\n<p><strong>Is saving to the PDF\/A format (for archival storage) supported?<\/strong><\/p>\n<p>Yes, PDF\/A compliance levels <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.export\/pdfcompliance\/\">are available<\/a> (including A-2a\/A-2b\/A-2u and A-3a\/A-3b) during export.<\/p>\n<p><strong>What happens to fonts during conversion: are they embedded or substituted?<\/strong><\/p>\n<p>There are flexible options: you can <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/embedded-font\/\">embed all glyphs or only used subsets<\/a>, specify a <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/fallback-font\/\">fallback font<\/a>, and <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/font-substitution\/\">control behavior<\/a> when a font lacks certain styles.<\/p>\n<p><strong>How can I control the quality and size of the resulting PDF?<\/strong><\/p>\n<p>Options are available for <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.export\/pdfoptions\/jpeg_quality\/\">JPEG quality<\/a>, <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.export\/pdfoptions\/text_compression\/\">text compression<\/a>, and a <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.export\/pdfoptions\/sufficient_resolution\/\">sufficient resolution<\/a> threshold for images, plus a mode that selects the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.export\/pdfoptions\/best_images_compression_ratio\/\">best compression for pictures<\/a>.<\/p>\n<p><strong>Can I export only a range of slides (for example, 5\u201312)?<\/strong><\/p>\n<p>Yes, export supports selecting a subset of slides.<\/p>\n<p><strong>Is multi-core processing of several files at the same time supported?<\/strong><\/p>\n<p>It is acceptable to process different presentations in parallel in separate processes. Important: the same <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">presentation<\/a> object must not be loaded or saved from <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/multithreading\/\">multiple threads<\/a>.<\/p>\n<p><strong>Are there risks when applying the license from different threads?<\/strong><\/p>\n<p>Yes, <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/licensing\/\">license-setting<\/a> calls are not thread-safe and require synchronization.<\/p>\n\n      "},{"title":"Python-Net: Save Presentations in Python","link":"https:\/\/docs.aspose.com\/slides\/python-net\/save-presentation\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/docs.aspose.com\/slides\/python-net\/save-presentation\/","description":"\n        \n        \n        <h2 id=\"overview\"><strong>Overview<\/strong><\/h2>\n<p><a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/open-presentation\/\">Open a Presentation in Python<\/a> described how to use the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> class to open a presentation. This article explains how to create and save presentations. The <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> class contains a presentation\u2019s contents. Whether you\u2019re creating a presentation from scratch or modifying an existing one, you\u2019ll want to save it when you\u2019re finished. With Aspose.Slides for Python, you can save to a <strong>file<\/strong> or <strong>stream<\/strong>. This article explains the different ways to save a presentation.<\/p>\n<h2 id=\"save-presentations-to-files\"><strong>Save Presentations to Files<\/strong><\/h2>\n<p>Save a presentation to a file by calling the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> class\u2019s <code>save<\/code> method. Pass the file name and save format to the method. The following example show how to save a presentation with Aspose.Slides for Python.<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"c1\"># Instantiate the Presentation class that represents a presentation file.<\/span>\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">()<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    \n    <span class=\"c1\"># Do some work here...<\/span>\n\n    <span class=\"c1\"># Save the presentation to a file.<\/span>\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;output.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"save-presentations-to-streams\"><strong>Save Presentations to Streams<\/strong><\/h2>\n<p>You can save a presentation to a stream by passing an output stream to the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> class\u2019s <code>save<\/code> method. A presentation can be written to many stream types. In the example below, we create a new presentation, add text to a shape, and save it to a stream.<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"c1\"># Instantiate the Presentation class that represents a presentation file.<\/span>\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">()<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    <span class=\"k\">with<\/span> <span class=\"nb\">open<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;output.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"s2\">&#34;bw&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">file_stream<\/span><span class=\"p\">:<\/span>\n        <span class=\"c1\"># Save the presentation to the stream.<\/span>\n        <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"n\">file_stream<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"save-presentations-with-a-predefined-view-type\"><strong>Save Presentations with a Predefined View Type<\/strong><\/h2>\n<p>Aspose.Slides for Python lets you set the initial view that PowerPoint uses when the generated presentation opens through the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/viewproperties\/\">ViewProperties<\/a> class. Set the <code>last_view<\/code> property to a value from the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/viewtype\/\">ViewType<\/a> enumeration.<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">()<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">view_properties<\/span><span class=\"o\">.<\/span><span class=\"n\">last_view<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">ViewType<\/span><span class=\"o\">.<\/span><span class=\"n\">SLIDE_MASTER_VIEW<\/span>\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;slide_master_view.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"save-presentations-in-the-strict-office-open-xml-format\"><strong>Save Presentations in the Strict Office Open XML Format<\/strong><\/h2>\n<p>Aspose.Slides lets you save a presentation in the Strict Office Open XML format. Use the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.export\/pptxoptions\/\">PptxOptions<\/a> class and set its conformance property when saving. If you set <code>Conformance.ISO_29500_2008_STRICT<\/code>, the output file is saved in the Strict Office Open XML format.<\/p>\n<p>The example below creates a presentation and saves it in the Strict Office Open XML format.<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"n\">options<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">PptxOptions<\/span><span class=\"p\">()<\/span>\n<span class=\"n\">options<\/span><span class=\"o\">.<\/span><span class=\"n\">conformance<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">Conformance<\/span><span class=\"o\">.<\/span><span class=\"n\">ISO_29500_2008_STRICT<\/span>\n\n<span class=\"c1\"># Instantiate the Presentation class that represents a presentation file.<\/span>\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">()<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    <span class=\"c1\"># Save the presentation in the Strict Office Open XML format.<\/span>\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;strict_office_open_xml.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">,<\/span> <span class=\"n\">options<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"save-presentations-in-office-open-xml-format-in-zip64-mode\"><strong>Save Presentations in Office Open XML Format in Zip64 Mode<\/strong><\/h2>\n<p>An Office Open XML file is a ZIP archive that imposes 4 GB (2^32 bytes) limits on the uncompressed size of any file, the compressed size of any file, and the total size of the archive, and it also limits the archive to 65,535 (2^16-1) files. ZIP64 format extensions raise these limits to 2^64.<\/p>\n<p>The <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.export\/pptxoptions\/zip_64_mode\/\">PptxOptions.zip_64_mode<\/a> property lets you choose when to use ZIP64 format extensions when saving an Office Open XML file.<\/p>\n<p>This property provides the following modes:<\/p>\n<ul>\n<li><code>IF_NECESSARY<\/code> uses ZIP64 format extensions only if the presentation exceeds the limitations above. This is the default mode.<\/li>\n<li><code>NEVER<\/code> never uses ZIP64 format extensions.<\/li>\n<li><code>ALWAYS<\/code> always uses ZIP64 format extensions.<\/li>\n<\/ul>\n<p>The following code demonstrates how to save a presentation as PPTX with ZIP64 format extensions enabled:<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"n\">pptx_options<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">PptxOptions<\/span><span class=\"p\">()<\/span>\n<span class=\"n\">pptx_options<\/span><span class=\"o\">.<\/span><span class=\"n\">zip_64_mode<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">Zip64Mode<\/span><span class=\"o\">.<\/span><span class=\"n\">ALWAYS<\/span>\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;sample.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;output_zip64.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">,<\/span> <span class=\"n\">pptx_options<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div>\n\n<div class=\"alert alert-warning\" role=\"alert\">\n<h4 class=\"alert-heading\">NOTE<\/h4>\nWhen you save with <code>Zip64Mode.NEVER<\/code>, a <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/pptxexception\/\">PptxException<\/a> is thrown if the presentation cannot be saved in ZIP32 format.\n<\/div>\n\n<h2 id=\"save-presentations-without-refreshing-the-thumbnail\"><strong>Save Presentations without Refreshing the Thumbnail<\/strong><\/h2>\n<p>The <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides.export\/pptxoptions\/refresh_thumbnail\/\">PptxOptions.refresh_thumbnail<\/a> property controls thumbnail generation when saving a presentation to PPTX:<\/p>\n<ul>\n<li>If set to <code>True<\/code>, the thumbnail is refreshed during save. This is the default.<\/li>\n<li>If set to <code>False<\/code>, the current thumbnail is preserved. If the presentation has no thumbnail, none is generated.<\/li>\n<\/ul>\n<p>In the code below, the presentation is saved to PPTX without refreshing its thumbnail.<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"kn\">import<\/span> <span class=\"nn\">aspose.slides<\/span> <span class=\"kn\">as<\/span> <span class=\"nn\">slides<\/span>\n\n<span class=\"n\">pptx_options<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">PptxOptions<\/span><span class=\"p\">()<\/span>\n<span class=\"n\">pptx_options<\/span><span class=\"o\">.<\/span><span class=\"n\">refresh_thumbnail<\/span> <span class=\"o\">=<\/span> <span class=\"bp\">False<\/span>\n\n<span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;sample.pptx&#34;<\/span><span class=\"p\">)<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;output.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">,<\/span> <span class=\"n\">pptx_options<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div>\n\n<div class=\"alert alert-info\" role=\"alert\">\n<h4 class=\"alert-heading\">Info<\/h4>\nThis option helps reduce the time required to save a presentation in PPTX format.\n<\/div>\n\n\n\n<div class=\"alert alert-info\" role=\"alert\">\n<h4 class=\"alert-heading\">Info<\/h4>\nAspose has developed a <a href=\"https:\/\/products.aspose.app\/slides\/splitter\">free PowerPoint Splitter app<\/a> using its own API. The app lets you split a presentation into multiple files by saving selected slides as new PPTX or PPT files.\n<\/div>\n\n<h2 id=\"faq\"><strong>FAQ<\/strong><\/h2>\n<p><strong>Is &ldquo;fast save&rdquo; (incremental save) supported so only changes are written?<\/strong><\/p>\n<p>No. Saving creates the full target file each time; incremental &ldquo;fast save&rdquo; isn\u2019t supported.<\/p>\n<p><strong>Is it thread-safe to save the same Presentation instance from multiple threads?<\/strong><\/p>\n<p>No. A <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> instance <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/multithreading\/\">isn\u2019t thread-safe<\/a>; save it from a single thread.<\/p>\n<p><strong>What happens to hyperlinks and externally linked files when saving?<\/strong><\/p>\n<p><a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/manage-hyperlinks\/\">Hyperlinks<\/a> are preserved. External linked files (e.g., videos via relative paths) aren\u2019t copied automatically\u2014ensure the referenced paths remain accessible.<\/p>\n<p><strong>Can I set\/save document metadata (Author, Title, Company, Date)?<\/strong><\/p>\n<p>Yes. Standard <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/presentation-properties\/\">document properties<\/a> are supported and will be written to the file on save.<\/p>\n\n      "},{"title":"Python-Net: Manage Slide Show in Python","link":"https:\/\/docs.aspose.com\/slides\/python-net\/manage-slide-show\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/docs.aspose.com\/slides\/python-net\/manage-slide-show\/","description":"\n        \n        \n        <p>In Microsoft PowerPoint, the <strong>Slide Show<\/strong> settings are a key tool for preparing and delivering professional presentations. One of the most important features in this section is <strong>Set Up Show<\/strong>, which allows you to tailor your presentation to specific conditions and audiences, ensuring flexibility and convenience. With this feature, you can select the show type (e.g., presented by a speaker, browsed by an individual, or browsed at a kiosk), enable or disable looping, choose specific slides to display, and use timings. This step in preparation is crucial for making your presentation more effective and professional.<\/p>\n<p><code>slide_show_settings<\/code> is a property of the <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentation\/\">Presentation<\/a> class, of type <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/slideshowsettings\/\">SlideShowSettings<\/a>, which allows you to manage the slide show settings in a PowerPoint presentation. In this article, we will explore how to use this property to configure and control various aspects of slide show settings.<\/p>\n<h2 id=\"select-show-type\"><strong>Select Show Type<\/strong><\/h2>\n<p><code>SlideShowSettings.slide_show_type<\/code> defines the type of slide show, which can be an instance of the following classes: <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/presentedbyspeaker\/\">PresentedBySpeaker<\/a>, <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/browsedbyindividual\/\">BrowsedByIndividual<\/a>, or <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/browsedatkiosk\/\">BrowsedAtKiosk<\/a>. Using this property allows you to adapt the presentation for different usage scenarios, such as automated kiosks or manual presentations.<\/p>\n<p>The code example below creates a new presentation and sets the show type to &ldquo;Browsed by an individual&rdquo; without displaying the scrollbar.<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">()<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n\n    <span class=\"n\">show_type<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">BrowsedByIndividual<\/span><span class=\"p\">()<\/span>\n    <span class=\"n\">show_type<\/span><span class=\"o\">.<\/span><span class=\"n\">show_scrollbar<\/span> <span class=\"o\">=<\/span> <span class=\"bp\">False<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slide_show_settings<\/span><span class=\"o\">.<\/span><span class=\"n\">slide_show_type<\/span> <span class=\"o\">=<\/span> <span class=\"n\">show_type<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;output.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"enable-show-options\"><strong>Enable Show Options<\/strong><\/h2>\n<p><code>SlideShowSettings.loop<\/code> determines whether the slide show should repeat in a loop until manually stopped. This is useful for automated presentations that need to run continuously. <code>SlideShowSettings.show_narration<\/code> determines whether voice narrations should be played during the slide show. It is useful for automated presentations that contain voice guidance for the audience. <code>SlideShowSettings.show_animation<\/code> determines whether animations added to slide objects should be played. This is useful for providing the full visual effect of the presentation.<\/p>\n<p>The following code example creates a new presentation and loops the slide show.<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">()<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slide_show_settings<\/span><span class=\"o\">.<\/span><span class=\"n\">loop<\/span> <span class=\"o\">=<\/span> <span class=\"bp\">True<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;output.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"select-slides-to-show\"><strong>Select Slides to Show<\/strong><\/h2>\n<p><code>SlideShowSettings.slides<\/code> property allows you to select a range of slides to be shown during the presentation. This is useful when you need to show only part of the presentation rather than all slides. The following code example creates a new presentation and sets the slide range to display from slides <code>2<\/code> to <code>9<\/code>.<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">()<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n    \n    <span class=\"n\">slide_range<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">SlidesRange<\/span><span class=\"p\">()<\/span>\n    <span class=\"n\">slide_range<\/span><span class=\"o\">.<\/span><span class=\"n\">start<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">2<\/span>\n    <span class=\"n\">slide_range<\/span><span class=\"o\">.<\/span><span class=\"n\">end<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">9<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slide_show_settings<\/span><span class=\"o\">.<\/span><span class=\"n\">slides<\/span> <span class=\"o\">=<\/span> <span class=\"n\">slide_range<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;output.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"use-advance-slides\"><strong>Use Advance Slides<\/strong><\/h2>\n<p><code>SlideShowSettings.use_timings<\/code> property allows you to enable or disable the use of preset timings for each slide. This is useful for automatically showing slides with pre-defined display durations. The code example below creates a new presentation and disables the use of timings.<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">()<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slide_show_settings<\/span><span class=\"o\">.<\/span><span class=\"n\">use_timings<\/span> <span class=\"o\">=<\/span> <span class=\"bp\">False<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;output.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"show-media-controls\"><strong>Show Media Controls<\/strong><\/h2>\n<p><code>SlideShowSettings.show_media_controls<\/code> property determines whether media controls (such as play, pause, and stop) should be displayed during the slide show when multimedia content (e.g., video or audio) is played. This is useful when you want to give the presenter control over media playback during the presentation.<\/p>\n<p>The following code example creates a new presentation and enables media controls to be displayed.<\/p>\n<div class=\"highlight\"><pre class=\"chroma\"><code class=\"language-py\" data-lang=\"py\"><span class=\"k\">with<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">Presentation<\/span><span class=\"p\">()<\/span> <span class=\"k\">as<\/span> <span class=\"n\">presentation<\/span><span class=\"p\">:<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">slide_show_settings<\/span><span class=\"o\">.<\/span><span class=\"n\">show_media_controls<\/span> <span class=\"o\">=<\/span> <span class=\"bp\">True<\/span>\n\n    <span class=\"n\">presentation<\/span><span class=\"o\">.<\/span><span class=\"n\">save<\/span><span class=\"p\">(<\/span><span class=\"s2\">&#34;output.pptx&#34;<\/span><span class=\"p\">,<\/span> <span class=\"n\">slides<\/span><span class=\"o\">.<\/span><span class=\"n\">export<\/span><span class=\"o\">.<\/span><span class=\"n\">SaveFormat<\/span><span class=\"o\">.<\/span><span class=\"n\">PPTX<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><h2 id=\"faq\"><strong>FAQ<\/strong><\/h2>\n<p><strong>Can I save a presentation so it opens directly in slide show mode?<\/strong><\/p>\n<p>Yes. Save the file as PPSX or PPSM; these formats launch directly in slide show when opened in PowerPoint. In Aspose.Slides, choose the corresponding save format <a href=\"https:\/\/docs.aspose.com\/slides\/slides\/python-net\/save-presentation\/\">during export<\/a>.<\/p>\n<p><strong>Can I exclude individual slides from the show without deleting them from the file?<\/strong><\/p>\n<p>Yes. Mark a slide as <a href=\"https:\/\/reference.aspose.com\/slides\/python-net\/aspose.slides\/slide\/hidden\/\">hidden<\/a>. Hidden slides remain in the presentation but are not displayed during the slide show.<\/p>\n<p><strong>Can Aspose.Slides play a slide show or control a live presentation on screen?<\/strong><\/p>\n<p>No. Aspose.Slides edits, analyzes, and converts presentation files; the actual playback is handled by a viewer application such as PowerPoint.<\/p>\n\n      "}]}}