From 7c22c0202e8ed706d33f301e65f0aa1a847b4ec4 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Mon, 13 Sep 2021 18:16:19 +0100 Subject: pptx: Support specifying slide background images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the reveal-js output, it’s possible to use reveal’s `data-background-image` class on a slide’s title to specify a background image for the slide. With this commit, it’s possible to use `background-image` in the same way for pptx output. Only the “stretch” mode is supported, and the background image is centred around the slide in the image’s larger axis, matching the observed default behaviour of PowerPoint. - Support `background-image` per slide. - Add tests. - Update manual. --- test/pptx/background-image/deleted-layouts.pptx | Bin 0 -> 56282 bytes test/pptx/background-image/input.native | 17 +++++++++++++++++ test/pptx/background-image/moved-layouts.pptx | Bin 0 -> 66987 bytes test/pptx/background-image/output.pptx | Bin 0 -> 53408 bytes test/pptx/background-image/templated.pptx | Bin 0 -> 66487 bytes 5 files changed, 17 insertions(+) create mode 100644 test/pptx/background-image/deleted-layouts.pptx create mode 100644 test/pptx/background-image/input.native create mode 100644 test/pptx/background-image/moved-layouts.pptx create mode 100644 test/pptx/background-image/output.pptx create mode 100644 test/pptx/background-image/templated.pptx (limited to 'test/pptx') diff --git a/test/pptx/background-image/deleted-layouts.pptx b/test/pptx/background-image/deleted-layouts.pptx new file mode 100644 index 000000000..05d4104b7 Binary files /dev/null and b/test/pptx/background-image/deleted-layouts.pptx differ diff --git a/test/pptx/background-image/input.native b/test/pptx/background-image/input.native new file mode 100644 index 000000000..22b089a95 --- /dev/null +++ b/test/pptx/background-image/input.native @@ -0,0 +1,17 @@ +[Header 1 ("section-header-with-background-image",[],[("background-image","movie.jpg")]) [Str "Section",Space,Str "Header",Space,Str "(with",Space,Str "background",Space,Str "image)"] +,Header 2 ("slide-1",[],[("background-image","lalune.jpg")]) [Str "Slide",Space,Str "1"] +,Para [Str "This",Space,Str "slide",Space,Str "has",Space,Str "a",Space,Str "moon",Space,Str "background."] +,Header 2 ("slide-2",[],[("background-image","movie.jpg")]) [Str "Slide",Space,Str "2"] +,Para [Str "This",Space,Str "slide",Space,Str "has",Space,Str "a",Space,Str "movie",Space,Str "background."] +,Header 2 ("slide-3",[],[("background-image","movie.jpg")]) [Str "Slide",Space,Str "3"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "Background",Space,Str "images",Space,Str "work",Space,Str "in",Space,Str "two-column",Space,Str "layout."]] + ,Div ("",["column"],[]) + [Para [Str "hello"]]] +,Header 2 ("slide-4",[],[("background-image","movie.jpg")]) [Str "Slide",Space,Str "4"] +,Para [Str "You",Space,Str "can",Space,Str "have",Space,Str "images",Space,Str "on",Space,Str "slides",Space,Str "that",Space,Str "have",Space,Str "background",Space,Str "images:"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")] +,Header 2 ("section",[],[("background-image","lalune.jpg")]) [] +,Div ("",["notes"],[]) + [Para [Str "Blank",Space,Str "slides",Space,Str "can",Space,Str "have",Space,Str "background",Space,Str "images."]]] diff --git a/test/pptx/background-image/moved-layouts.pptx b/test/pptx/background-image/moved-layouts.pptx new file mode 100644 index 000000000..73b69e1d6 Binary files /dev/null and b/test/pptx/background-image/moved-layouts.pptx differ diff --git a/test/pptx/background-image/output.pptx b/test/pptx/background-image/output.pptx new file mode 100644 index 000000000..9738eefb8 Binary files /dev/null and b/test/pptx/background-image/output.pptx differ diff --git a/test/pptx/background-image/templated.pptx b/test/pptx/background-image/templated.pptx new file mode 100644 index 000000000..52d304957 Binary files /dev/null and b/test/pptx/background-image/templated.pptx differ -- cgit v1.2.3