Page 1 of 1

Editing background of template

PostPosted: Mon Dec 22, 2008 7:13 am
by JJJoseph
How do I extract the background of one of the pre-made Impress templates? I'd like to modify the template and save it as a new template. There's nothing in the Help department.

Re: Editing background of template

PostPosted: Mon Dec 22, 2008 5:04 pm
by acknak
Why do you want to "extract" a background? Just click on "Master Pages" in the task panel at the right of the Impress window; all of the backgrounds (and some more, I think) from the included templates are there. Just click on the one you want.

If you really want to get at the template files, they are in directories .../basis3.0/share/template/en-US/layout and .../.../presnt on my Linux system; I expect that the location will similar for Windows or Mac, just change the beginning. Try a file search for a folder named 'presnt'--that should get you started, then go up one step and over into 'layout'.

You may not be able to extract a background for some of the presentation templates: they may be based on an area-fill, not a background image.

As an alternative approach, you could make a slide with one of the templates, then export the slide as an image, then import the image into a new presentation as the background.

Re: Editing background of template

PostPosted: Fri Dec 26, 2008 7:33 am
by JJJoseph
Yes, I can see the master templates, but they're still templates. How do i get at the background image to change it? All I get is the aggregated template, with no access to the components. Same with the "presnt" folder (and the higher folders in the sequence). It's full of .otp templates only. Higher directories are filed with .otg,.ott,&.ots templates.

I'm thinking that the templates are likely built-up from components like .jpg files, etc. but I can't figure out how it's done. I'd like to do this to make company-specific templates for others to use, and then delete all the previous generic templates.

Re: Editing background of template

PostPosted: Fri Dec 26, 2008 7:03 pm
by acknak
Let's get specific. Pick a template that you're interested in, and then we can talk specifically about how to get access to the background for that template.

Re: Editing background of template

PostPosted: Wed Jan 07, 2009 7:57 am
by JJJoseph
acknak wrote:Let's get specific. Pick a template that you're interested in, and then we can talk specifically about how to get access to the background for that template.


OK, let's try "desert.otp". I want to add some figures to the background.

PS: I apologise for the time lag over the holidays. I'm back at my desk now

Re: Editing background of template

PostPosted: Wed Jan 07, 2009 5:51 pm
by acknak
No problem--Happy 2009!

Sorry, I don't have a template called "desert.otp". Is is something you downloaded?

Well, I found a template with that name here: http://documentation.openoffice.org/Samples_Templates/User/template_2_x/impress/index.html that looks like this:
thumbnail.png
thumbnail.png (33.49 KiB) Viewed 11328 times

If that's the one you mean, then ok, I see what you're after. I never noticed that before: a presentation that has the background set as a bitmap image does not leave any way to access or select the image. You can change the background to something else, but you can't get the background out to work with the image.

In that case, the simplest thing is to just open the document in a Zip archive utility (all OOo/ODF files are actually Zip archives) and extract the image from the archive.

Here's what I see in that file:
    $ unzip -l Desert.otp
    Archive: Desert.otp
      Length     Date   Time    Name
    -------- ---- ---- ----
    56 10-30-06 20:47 mimetype
    0 10-30-06 20:47 Configurations2/statusbar/
    0 10-30-06 20:47 Configurations2/accelerator/current.xml
    0 10-30-06 20:47 Configurations2/floater/
    0 10-30-06 20:47 Configurations2/popupmenu/
    0 10-30-06 20:47 Configurations2/progressbar/
    0 10-30-06 20:47 Configurations2/menubar/
    0 10-30-06 20:47 Configurations2/toolbar/
    0 10-30-06 20:47 Configurations2/images/Bitmaps/

    965189 10-30-06 20:47 Pictures/100000000000040000000300438F4949.png
    8861 10-30-06 20:47 content.xml
    53147 10-30-06 20:47 styles.xml
    1225 10-30-06 20:47 meta.xml
    39926 10-30-06 20:47 Thumbnails/thumbnail.png
    10003 10-30-06 20:47 settings.xml
    2084 10-30-06 20:47 META-INF/manifest.xml
    -------- -------
    1080491 16 files
You can extract the files in the Pictures folder and do whatever you need to do.

If you edit the picture (you need some other software for that; OOo doesn't do image editing), you can keep the same name and replace the image in the original document file, again using your zip archive tool.

Alternatively, you can modify the image and rename it (e.g. if you wanted to use it with other projects), then change the background of the presentation to use the edited image: (in Impress) right-click on the slide background > Slide > Set Background Picture for Slide.

Here's a version of that template with a colorized (and much smaller) background image: Desert_brown.otp.

Re: Editing background of template

PostPosted: Thu Jan 08, 2009 1:45 am
by JJJoseph
Exactly! That's what I was trying to do. There's no clue in the Help docs that the template is a zip file. I'm still not clear what the rest of the bits are, or how they're created, in case I wanted to create my own templates. Is there an OO application for creating templates?

Also, is there anything in the Help docs that explains this? I couldn't find anything.

Regardless, I'm now able to modify existing templates, so many thanks!

Re: Editing background of template

PostPosted: Thu Jan 08, 2009 6:47 am
by acknak
Is there an OO application for creating templates?

Yes, it's called "Impress" ;-)

A template document is really just a plain document--well, almost. The main things that make it special are: 1) the file is marked as a template instead of just a regular document, and 2) the file is in a special location so that OOo knows to include it in the list of templates, and even the special location is optional.

There's nothing in the help about the file structure, as that's really nothing you need to know to use the software.

If you want to know more about presentation templates, I suggest a look at the Impress Guide.

Re: Editing background of template

PostPosted: Tue Jan 13, 2009 4:00 am
by JJJoseph
acknak wrote:A template document is really just a plain document--well, almost. The main things that make it special are: 1) the file is marked as a template instead of just a regular document, and 2) the file is in a special location so that OOo knows to include it in the list of templates, and even the special location is optional.


It's in the "--well, almost" part that the answer lies! You demonstrated that the template is a "zip" file. How does the zip process work that results in an "odt" result? Anything I try results in a "zip" file.

If you want to know more about presentation templates, I suggest a look at the Impress Guide.


Went there to give it a try, but even though I have Java 6, I get the following if I try to search anything related to "template":

An error has occured: java.io.IOException: Lock obtain timed out: Lock@/var/lib/tomcat5.5/webapps/ROOT/WEB-INF/work/cache-dir/lucene-e0d8e2552e2e1d45d7e9207cf12d9cd9-commit.lock

I'm not expert at decoding Java error messages. Also as you can see, I'm not very successful figuring out OO on my own. So I'm back here again :-)

Re: Editing background of template

PostPosted: Tue Jan 13, 2009 5:00 am
by acknak
That's not a Java error on your system, it's an error on the system that hosts the wiki. It's probably just a temporary condition--it worked for me just now.

Unfortunately, it's not a search of the particular Guide that you're interested in, it's a search of the entire OOo wiki. So, it may give you a lot of results that don't have anything to do with Impress.

Anyway, you can just skip right to Chapter 2: Using Slide Masters, Styles, and Templates.

Anything I try results in a "zip" file.

That's just a lack of flexibility in the zip utility. A zip archive is just a file, and you can name a file anything you like. If you can't configure your archive tool to create the archive with a ".odp" or ".otp" suffix on the file name, just create it as "mytemplate.zip" and then rename the file. If you're working in Windows, you probably need to have it show you the file extensions. Otherwise, Windows will ruin whatever name you give it by automatically tacking on the extension it thinks the file should have.

You can also come at the problem from the other direction: in OOo, just do File > Open, select your file.zip, and OK. OOo does not care what the file name is, as long as the contents match what's required for a valid ODF document.

Re: Editing background of template

PostPosted: Mon Jul 01, 2019 11:31 pm
by OrlandoRider
I too would like to "save" the image from a template, so I can modify it.

WInZip is apparently not "robust" enough to extract the PNG file. Do you have any other suggestions?

Re: Editing background of template

PostPosted: Fri Jul 05, 2019 10:43 am
by Hagar Delest
7zip works just fine for that.

Re: Editing background of template

PostPosted: Tue Jul 16, 2019 3:49 am
by OrlandoRider
Thanks - I'll look in to 7zip