#!/usr/bin/perl -w #============================================================= -*-perl-*- # # okxml2ps # # DESCRIPTION # Utility for converting XML kite part descriptions and layout markup # to PostScript, with automatic page tiling, registration mark control, # and path following text. Calls on the Kite::XML2PS module to do all # the work. # # AUTHOR # Simon Stapleton wrote the original xml2ps.pl # utility which performs the XML -> PostScript conversion. # # Andy Wardley re-packaged it into a module for # integration into the Kite bundle. # # COPYRIGHT # Copyright (C) 2000 Simon Stapleton, Andy Wardley. All Rights Reserved. # # This is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # # VERSION # $Id: okxml2ps,v 1.3 2000/10/17 11:58:16 abw Exp $ # #======================================================================== # for testing # use lib qw( ./lib ../lib ); use strict; use Kite::XML2PS; use Getopt::Long; my $PROGRAM = 'okxml2ps'; my $VERSION = 0.2; my $COPYRIGHT = 'Copyright 2000 Simon Stapleton, Andy Wardley'; my $infile; # the input file my $outfile; # the output file (STDOUT by default) my $title; # title for the document my $regmarks = 1; # registration marks disabled by default my $map = 1; # show tiling map my $border = 0; # border width in mm my $help; # help flag # read command line options eval { GetOptions ( "infile=s" => \$infile, "outfile=s" => \$outfile, "title=s" => \$title, "border=s" => \$border, "reg!" => \$regmarks, "map!" => \$map, "help" => \$help, ); }; die error($@) if $@; die help() if $help; # read input file from next command line argument unless $infile set $infile ||= shift(@ARGV); die error("no input file specified") unless $infile; # create Kite::XML2PS object to convert XML to PS my $ps = Kite::XML2PS->new({ filename => $infile, regmarks => $regmarks, map => $map, title => $title, border => $border, }) || die error($Kite::XML2PS::ERROR); # generate output document if ($outfile) { local *FH; open(FH, "> $outfile") || die error("$outfile: $!"); print FH $ps->doc(); close(FH); } else { print $ps->doc(); } #------------------------------------------------------------------------ # help() # # Return a string containing the program information and usage. #------------------------------------------------------------------------ sub help { return < script provides a simple user-interface to the Kite::XML2PS module. It reads in an XML file containing kite part defintions an layup and generates the relevant PostScript. =head1 AUTHORS Simon Stapleton wrote the original xml2ps.pl utility which performs the XML -> PostScript conversion. Andy Wardley re-packaged it as a module and accompanying script for integration into the Kite bundle. =head1 VERSION $Revision: 1.3 $ =head1 COPYRIGHT Copyright (C) 2000 Simon Stapleton, Andy Wardley. All Rights Reserved. This is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO See also L =cut