XML::Handler::AxPoint - AxPoint XML to PDF Slideshow generator
Using SAX::Machines:
use XML::SAX::Machines qw(Pipeline); use XML::Handler::AxPoint;
Pipeline( XML::Handler::AxPoint->new() )->parse_uri("presentation.axp");
Or using directly:
use XML::SAX; use XML::Handler::AxPoint;
my $parser = XML::SAX::ParserFactory->parser(
Handler => XML::Handler::AxPoint->new(
Output => "presentation.pdf"
)
);
$parser->parse_uri("presentation.axp");
This module is a port and enhancement of the AxKit presentation tool, AxPoint. It takes an XML description of a slideshow, and generates a PDF. The resulting presentations are very nice to look at, possibly rivalling PowerPoint, and almost certainly better than most other freeware presentation tools on Unix/Linux.
The presentations support slide transitions, PDF bookmarks, bullet points, source code (fixed font) sections, images, SVG vector graphics, tables, colours, bold and italics, hyperlinks, and transition effects for all the bullet points, source, and image sections.
This is the outer element, and must always be present.
<slideshow>
<title>My First Presentation</title>
The title of the slideshow, used on the first (title) slide.
<metadata>
<speaker>Matt Sergeant</speaker>
<email>matt@axkit.com</email>
<organisation>AxKit.com Ltd</organisation>
<link>http://axkit.com/</link>
<logo scale="0.4">ax_logo.png</logo>
<background>redbg.png</background>
</metadata>
Metadata for the slideshow. Speaker and Organisation are used on the first (title) slide, and the email and link are turned into hyperlinks.
The background and logo are used on every slide.
<slideset>
<title>A subset of the show</title>
<subtitle>And a subtitle for it</subtitle>
A slideset groups slides into relevant subsets, with a title and a new level in the bookmarks for the PDF.
The title and subtitle tags can have href attributes which turn those
texts into links.
<slide transition="dissolve">
<title>Introduction</title>
<point>Perl's XML Capabilities</point>
<source-code>use XML::SAX;</source-code>
</slide>
The slide tag defines a single slide. Each top level tag in the slide
can have a transition attribute, which either defines a transition
for the entire slide, or for the individual top level items.
The valid settings for transition are:
For example, to have each point on a slide reveal themselves one by one:
<slide>
<title>Transitioning Bullet Points</title>
<point transition="replace">Point 1</point>
<point transition="replace">Point 2</point>
<point transition="replace">Final Point</point>
</slide>
The point specifies a bullet point to place on your slide.
The point may have a href attribute, a transition attribute,
and a level attribute. The level attribute defaults to 1, for
a top level bullet point, and can go down as far as you please.
The source-code tag identifies a piece of verbatim text in a fixed font - originally designed for source code.
The image tag works in one of two ways. For backwards compatibility it allows you to specify the URI of the image in the text content of the tag:
<image>foo.png</image>
Or for compatibility with SVG, you can use xlink:
<image xlink:href="foo.png"
xmlns:xlink="http://www.w3.org/1999/xlink"/>
By default, the image is placed centered in the current column (which is the middle of the slide if you are not using tables) and at the current text position. However you can override this using x and y attributes for absolute positioning. You may also specify a scale attribute to scale the image. Currently absolute width and height values are not supported, but it is planned to support them.
The supported image formats are those supported by the underlying pdflib library: gif, jpg, png and tiff.
The colour tag specifies a colour for the text to be output. To define
the colour, either use the name attribute, using one of the 16 HTML
named colours, or use the rgb attribute and use a hex triplet
like you can in HTML.
Use these tags for italics and bold within text.
<table>
<row>
<col width="40%">
...
</col>
<col width="60%">
...
</col>
</row>
</table>
AxPoint has some rudimentary table support, as you can see above. This is fairly experimental, and does not do any reflowing like HTML - it only supports fixed column widths and only as percentages. Using a table allows you to layout a slide in two columns, and also have multi-row descriptions of source code with bullet points.
AxPoint has some SVG support so you can do vector graphics on your slides.
All SVG items allow the transition attribute as defined above.
<rect x="100" y="100" width="300" height="200"
style="stroke: blue; stroke-width=5; fill: red"/>
As you can see, AxPoint's SVG support uses CSS to define the style. The above draws a rectangle with a thick blue line around it, and filled in red.
<circle cx="50" cy="100" r="50" style="stroke: black"/>
<ellipse cx="100" cy="50" rx="30" ry="60" style="fill: aqua;"/>
<line x1="50" y1="50" x2="200" y2="200" style="stroke: black;"/>
<text x="200" y="200"
style="stroke: black; fill: none; font: italic 24pt serif"
>Some Floating Text</text>
This tag allows you to float text anywhere on the screen.
Please use http://rt.cpan.org/ for reporting bugs.
Matt Sergeant, matt@sergeant.org
Copyright 2002.
This is free software, distributed under the same terms as Perl itself.