Automate it! - Recipes to upskill your business by Chetan Giridhar
Author:Chetan Giridhar [Giridhar, Chetan]
Language: eng
Format: azw3, pdf
Publisher: Packt Publishing
Published: 2017-01-30T16:00:00+00:00
How it works...
In this recipe, we used the blank template to add a two-content layout slide. Let's see what else we did on top of it:
In the code, we used prs.slide_layouts[3] to convey the presentation object, prs, to add a slide with the two content layout. The two-content layout also has a title text, which was updated to Adding a Two Content Slide by using the shapes.title attribute.
Next, we looked at the placeholders. A placeholder is a preformatted container to which content can be added. Placeholders are categories of shape, which means multiple shapes can have placeholders. For instance, an autoshape (circle, as seen in the first recipe) is a placeholder; a picture or graphic frame can be a placeholder. We have two placeholders, one on the left and one on the right, in a two-content slide. We targeted the left one with shapes.placeholders[1] and added a first line This is line 1. to the text frame referenced by shapes.placeholders[1].text_frame.
We then added bulleted lines by adding a paragraph to text_frame with the add_paragraph() method and added the text Again a line 2... at level one and And this is line 3... at level two.
Basically, not all shapes contain text, but finding if a shape supports text can be done using the shape.has_text_frame attribute. In this recipe, we know our shape contains a placeholder that can handle text content. So, we used the text_frame attribute to add the first line of text. Similarly, we used the add_paragraph() method to add the subsequent lines in bulleted fashion using the level attribute.
In the end, we saved the new presentation under the name, two_content.pptx. If you look at the screenshot, we see the bulleted look on the text added to the left text frame on the slide.
Download
Automate it! - Recipes to upskill your business by Chetan Giridhar.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12592)
Hello! Python by Anthony Briggs(9928)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9803)
The Mikado Method by Ola Ellnestam Daniel Brolund(9787)
Dependency Injection in .NET by Mark Seemann(9348)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8310)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7772)
Grails in Action by Glen Smith Peter Ledbrook(7705)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7567)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7173)
Microservices with Go by Alexander Shuiskov(6943)
Practical Design Patterns for Java Developers by Miroslav Wengner(6857)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6801)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6424)
Angular Projects - Third Edition by Aristeidis Bampakos(6218)
The Art of Crafting User Stories by The Art of Crafting User Stories(5735)
NetSuite for Consultants - Second Edition by Peter Ries(5663)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5479)
Kotlin in Action by Dmitry Jemerov(5074)
