A Slide-Show Presentation via SVG - Part 1 of Chapter 7 from Perl Graphics Programming (1/4)
[next] |
Perl Graphics Programming, Chapter 7: Creating SVG with Perl
A Slide-Show Presentation
Many programs let you build presentations, the biggest and best-known of which is Microsoft's Powerpoint. In this section we develop a program that transforms an XML file describing a slide-show presentation (slides, bullet items, etc.) into an SVG file that is the presentation.
The input file consists of a collection of any of the following six tags:
|
A complete slide show file written in this format looks like Example 7-1.
Example 7-1: Sample slideshow file
<slideshow subdir="./slideshow1/">
<slide title="Perl for Graphics">
<image>https://shawn.apocabilly.org/PFG/examples/shawn.png
</image>
<block type="textline">Section I: File Formats</block>
<block type="bulletlist">
<bullet>1. Raster Graphics Formats</bullet>
<bullet>2. Efficient Multimedia with SWF</bullet>
<bullet>3. The SVG format</bullet>
<bullet>4. Printing with PostScript and PDF</bullet>
</block>
<block type="textline">Section II: Tools</block>
...
</slide>
<slide title="Chapter 1">
<image>https://shawn.apocabilly.org/PFG/examples/shawn.png
</image>
<block type="textline">Web Graphics Basics</block>
<block type="bulletlist">
<bullet>Fields and Streams</bullet>
<bullet>Color tables</bullet>
<bullet>Transparency and alpha</bullet>
<bullet>Compression</bullet>
<bullet>Interlacing</bullet>
<bullet>Which to use when?</bullet>
</block>
...
</slide>
</slideshow>
When given the file in Example 7-1, the output of our program is the presentation shown in Figure 7-1.
Figure 7-1. Two linked SVG slides generated from an XML slideshow definition file
[next] |
Created: February 12, 2003
Revised: February 12, 2003
URL: https://webreference.com/programming/perl/chap7/1/