Andy Wardley > Kite > Kite::XML2PS

Download:
Kite-0.4.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.03   Source  

NAME ^

Kite::XML2PS - reads an XML curve definition file and generates PostScript

SYNOPSIS ^

    use Kite::XML2PS;

    my $ps = Kite::XML2PS( filename => 'example.xml' )
        || die $Kite::XML2PS::ERROR, "\n";

    # return PostScript definitions for image and image path
    print "image definition: ", $ps->image();
    print "image path: ", $ps->path();

    # generate entire PostScript document with tiling, etc.
    print $ps->doc();

DESCRIPTION ^

Module for converting an XML file containing curve definitions (see xml/kiteparts.dtd) into PostScript.

PUBLIC METHODS ^

new(\%config)

Constuctor method called to create a new Kite::XML2PS object. Accepts a reference to a hash array of configuration items or a list of name => value pairs. The following items may be specified:

filename

Specifies a filename from which the XML definition should be read. This parameter is mandatory. The XML content of this document should conform to the OpenKite layout format as specified in the xml/kiteparts.dtd file (relative to the distribution root directory).

title

Optional parameter which can be used to set the title for the document. Setting this value will override any title defined in the XML document.

regmarks

Enables registration marks when set to any true value.

border

Specifies a border width in mm (default: 5mm). The clipping area will be inset this distance from the imageable area on the page. This is useful for printers that can't actually print to the edge of the area that they think they can.

map

The tiling procedure adds a small map to the top left hand corner of each page, indicating the position of the current page within the tiling set. This option can be set to 0 to disable this feature.

The file specified via the filename option will be parsed and converted into PostScript definitions for the image as a whole (IMAGE) and the outline path (PATH). These can then be retrieved via the image() and path() method calls.

On error, the constructor returns undef. The error message generated can be retrieved by calling the error() class method, or by examining the $Kite::XML2PS::ERROR variable.

doc()

Returns a PostScript document containing the kite parts layed out as specified in the input file. The output is automatically tiled onto multiple pages.

image()

Returns a PostScript string defining the image for the parts parsed from the input file.

path()

Returns a PostScript string defining the the outline path of the parts parsed from the input file.

AUTHORS ^

Simon Stapleton <simon@tufty.co.uk> wrote the original xml2ps.pl utility which performs the XML -> PostScript conversion.

Andy Wardley <abw@kfs.org> re-packaged it into a module for integration into the Kite bundle.

REVISION ^

$Revision: 1.3 $

COPYRIGHT ^

Copyright (C) 2000 Simon Stapleton, Andy Wardley. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

See also Kite, Kite::PScript::Defs and okxml2ps.

syntax highlighting: