Can you change the theme of an existing powerpoint with Python-pptx? - themes

I was wondering if there was any way I could change the theme of an existing PowerPoint using Python-pptx.
I realise that the easiest way of inserting a specific theme of a powerpoint, you just open a "template powerpoint" with the theme in it. However, I want to automize converting themes of existing PowerPoints, I'm not creating new PowerPoints from scratch.
You might say: just copy and paste slides into the PowerPoint with a specific theme. However, copy and pasting slides is extremely error-prone as well, seeing they work with slide indices which seem quite tricky. And I'm not even sure whether the pasted slides automatically assume the theme of the new document.
Therefore I was wondering if anyone knew of some kind of theme object I could call and change using Python-pptx?
Thanks in advance

The short answer is no. Implementing that would be a fairly big deal and there are no current plans to add it.
If you wanted to do that to several decks, you might explore using Visual Basic for Applications to do it in a Microsoft Windows environment. You might also explore using the win32com interface to control the PowerPoint application from Python, I think that also requires a Windows environment.

Related

PowerPoint - how to run a macro automatically?

I'd like to run a macro that sets the zoom to 100%, something like Windows(1).View.Zoom = 100, every time ANY file is opened in PowerPoint. The files are already created, so using a template to set the zoom is not possible. How can I do this?
There isn't really a way (that I am aware of) to do this through a macro or powerpoint add-in. You might be able to do it using a custom web add-in but I don't have enough experience with that to provide an example.
After looking around there have been a few success stories. One of which is creating a custom UI element and then adding an onLoad hook to that.
Here is the thread.
Here is a link to the Custom UI Editor Tool However I had no luck in getting it to work. I believe (This is only my theory) that it is not compatible with the latest .NET framework.
If you do end up trying to do this, here is a link to the xml formatting documentation for UI elements. And a link to a little tutorial related to this.
Sorry I couldn't be of more help. This should at least get you started. If anyone else has a simpler way I would love to know as well.

Plugins to set Bookmarks with Inherit Zoom in Acrobat (Mac)?

At work, we are required to set "Inherit Zoom" on all bookmarks and links within PDF files (using Adobe Acrobat). I have been surprised at how difficult it is to set this across multiple bookmarks. I.e., the only native way I have found to do this is by manually right-clicking on each link and editing the properties to Inherit Zoom.
This is a problem for a number of reasons. For one, when you set Inherit Zoom on a bookmark, you can no longer direct that bookmark or link to a specific destination within a page (aka an anchor). You must set the bookmark or link to bring you to a page number instead.
I could deal with that and work around it, if there was some way to set Inherit Zoom as the default for a document. Unfortunately, it appears that Acrobat requires you to manually edit every single link and/or bookmark. As you can imagine, this is a huge undertaking when working with large PDFs with many bookmarks and internal links.
I have been reading through forums (Adobe, here, elsewhere) and help pages for hours trying to find an answer and it seems the only successful ones are installing a plug-in that can change these settings throughout a document in one fell swoop. I'm hesitant to install 3rd party plug-ins for both security reasons, and the fact that they are often expensive. We're certainly willing to pay for a plug-in that takes care of this issue, but if there's a better way to do it then I would like to explore other options. There's also the worry that after we buy a 3rd party plug-in, there's no guarantee how long it will be supported by the devs or compatible with newest versions of Acrobat.
This has (apparently) been a common problem and request by Acrobat users for over 5 years. Someone out there has to have a good solution. Any advice or recommendations on a reliable plug-in would be much appreciated!
I have created an open-source (Java-based) app that allows you to apply
Actual size
Fit page
Fit visible
Fit width
Inherit zoom
to all bookmarks within a PDF document or entire directories of PDFs (enclosing subdirectories included) without selecting each item manually:
https://github.com/beatngu13/pdf-zoom-wizard/
In case anyone with the same problem finds this, I was able to work around the issue by creating documents in a LaTex editor first, then converting to a PDF. The anchors created in the Latex editor had the Inherit Zoom functionality, if not the explicit settings in properties.
I also used the software Debenu Aerialist, which would have worked for editing links or bookmarks en masse. It's not a perfect solution or product but it worked.

file types grouped, how to ungroup

in windows 7, after installed Komodo Edit, i tried to change filetype icon using FileTypesMan from NirSoft, but as weird as it is, as soon as I change desription for .js it changes to the same too for .php and vice-versa the other way too. My guess is, maybe Komodo added it to some file types group, but dunno how to diferentiate them? My primary goal is to have a custom php icon for php and js files (each one different)
any experience anyone, or suggestions?
Newer heard before of such binding between different file extensions
Unfortunately Komodo uses your system file icons so it does not have direct control over what language icons you see. If you'd want to change those icons you would have to do it at the system level.
Note that we will most likely be using our own language icons in one of our next releases, which should solve issues like the one you are having.
Note that if you're feeling really adventurous you could develop an addon or customize the source directly (available at https://github.com/Komodo/KomodoEdit). Feel free to join us on IRC if you have any questions - #komodo on irc.mozilla.org.
Source: Komodo Dev.

Programmatically Inserting Data into an InDesign Document

I have to use Adobe InDesign for creating documents. We basically need to have a couple variables throughout the document (company name, project name, etc) that need to be filled in.
I was wondering if there is a way to take an existing template and maybe programmatically fill these in using a language I'm comfortable with (Ruby, Python, etc). I have tried to open the Adobe InDesign file using a text editor - but when I make modifications using Notepad++ and then open the file in InDesign, it tells me the file is corrupted.
If you have any insight with programmatically building InDesign documents or know of any tutorials that would be much appreciated.
P.S. I tried to check out Adobe's ExtendScript but wasn't finding much documentation applying to InDesign.
Thanks for the help!
There is no (legal) way to do this in Ruby/Python. Theoretically it is possible to edit InDesign documents directly using any language but:
It's nowhere near as easy as just making some text modifications, you would have to figure out more about the format, and
It's in direct violation of the InDesign license agreement meaning you could face legal action if Adobe finds out.
ExtendScript is perfect for doing small things like this. If you open up ExtendScript Toolkit and set the target to InDesign you can browse and search the entire API easily. Doing search/replace for simple text variables is not hard at all.
An alternative would be exporting the documents to the .idml language which is easier and legal to edit outside of InDesign.
You can use the DataMerge-feature of Indesign --> https://helpx.adobe.com/indesign/using/data-merge.html
I think this is exactly what you are looking for.
Or you can use the Indesign API. Have a look at Extendscript-Toolkit especially the ObjectModell-Viewer.
You need to convert your .indd file to .idml and unzi it.
In /Stories/Story_*.idml you may found all text variables.
And no easy ways to change text variables in .indd without Adobe products.

Windows Visual Themes: Gallery of Parts and States?

Microsoft Windows lets programmers draw GUI elements using the look and feel of the current theme using functions like DrawThemeBackground and DrawThemeText. The elements are specified by Class, Part, and State, as described at the Parts and States page at MSDN.
Unfortunately, the page is not very informative (at all!). So the question is: is there somewhere a reference of all these parts and states, preferably with images of the elements (in the default Windows Vista/7 theme)?
I have created a small Windows application, programmed with the table at Parts and States. This application lets the programmer browse and explore all parts and states, using the current OS theme.
(High-Res)
It can be downloaded at
https://privat.rejbrand.se/UxExplore.exe
The (Delphi, Win32 API) source, which is too long to be posted here (due to hundreds of constants) is found at
https://privat.rejbrand.se/UxExplore.zip
https://privat.rejbrand.se/UxExploreMain.html
https://privat.rejbrand.se/UxExploreConsts.html
You're looking for this.
Mike Lische, who wrote the first Theme support for Delphi (which was later absorbed by Borland) has a very good Theme Explorer demo application:
It's not been updated to support new Windows 7 common controls, but its parts/states explorer is very pretty.
And if i may say, Andreas, a design you might want to copy for yours :)
Much more comprehensive theme explorer: mCtrl Theme Explorer

Resources