spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / programming / perl / graphics / chap7 / 1 current pageTo page 2To page 3To page 4
[next]

Perl Graphics Programming, Chapter 7: Creating SVG with Perl

Sr Instructional Designer D2L-Moodle,Clearance
WSI Nationwide, Inc.
US-NJ-Fort Monmouth

Justtechjobs.com Post A Job | Post A Resume
Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs


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:

<slideshow>
The top-level tag

<slide>
A new slide in the sequence

<block>
A block can be either a line of text or a bullet list

<bulletlist>
A group of <bullet> elements

<bullet>
An indented line of text with a bullet prepended

<image>
An image to place in the upper left corner of the slide

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>http://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>http://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.

Two linked SVG slides generated from an XML slideshow definition file
Figure 7-1. Two linked SVG slides generated from an XML slideshow definition file


home / programming / perl / graphics / chap7 / 1 current pageTo page 2To page 3To page 4
[next]

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint

Created: February 12, 2003
Revised: February 12, 2003

URL: http://webreference.com/programming/perl/chap7/1/