Diff for /gobook.perl between versions 1.2 and 3.1

version 1.2, 2010/09/21 03:11:07 version 3.1, 2014/09/28 04:29:18
Line 1 Line 1
 #! /usr/bin/perl -w  #! /usr/bin/perl -w
   # $Id$
 use XML::Simple;  use XML::Simple;
 use strict;  use strict;
 use PostScript::Simple;  use PostScript::Simple;
Line 12  if ( defined $xml ){ Line 13  if ( defined $xml ){
     $strips = XMLin($xml, KeyAttr => {strip => 'id'});      $strips = XMLin($xml, KeyAttr => {strip => 'id'});
 }  }
   
 # create a new PostScript object  # create a new PostScript object;
 my $p = new PostScript::Simple(papersize => "A5",  
                           colour => 1,  my $p = new PostScript::Simple(papersize => "A5", 
                           eps => 0,                                    colour => 1,
                           units => "mm",);                                       eps => 0,
                                      units => "mm");
   
 # co-ords are horizontal, vertical. from bottom left corner. 148 x 210  # co-ords are horizontal, vertical. from bottom left corner. 148 x 210
   
Line 53  $p->setcolour(60,28,0); Line 55  $p->setcolour(60,28,0);
 $p->text(35,175, "Land-Out Guide");  $p->text(35,175, "Land-Out Guide");
 $p->setfont("Helvetica", 17);  $p->setfont("Helvetica", 17);
 $p->setcolour("white");  $p->setcolour("white");
 $p->text(12,52, "2nd Edition 1st Revision 2009");  $p->text(12,52, "3rd Edition 2013");
   
 $p->newpage;  $p->newpage;
 # Contents  # Contents
Line 94  $p->text($t1,$v, "Photos by Gavin Wills. Line 96  $p->text($t1,$v, "Photos by Gavin Wills.
 $v -= $ls;  $v -= $ls;
 $p->text($t1,$v, "Text by Phil Plane and Gavin Wills. ");  $p->text($t1,$v, "Text by Phil Plane and Gavin Wills. ");
 $v -= $ls;  $v -= $ls;
 $p->text($t1,$v, "Copyright GlideOmarama.com 2007.");  $p->text($t1,$v, "Copyright GlideOmarama.com 2013.");
 $v -= $ls;  $v -= $ls;
 $p->text($t1,$v, "First Edition published November 2007. ");  $p->text($t1,$v, "First Edition published November 2007. ");
 $v -= $ls;  $v -= $ls;
 $p->text($t1,$v, "Second Edition published November 2008. ");  $p->text($t1,$v, "Second Edition published November 2008. ");
 $v -= $ls;  $v -= $ls;
 $p->text($t1,$v, "Second Edition 1st Revision published November 2009. ");  $p->text($t1,$v, "Third Edition published November 2013. ");
 $p->text(70,5, "(" . $pn++ . ")");  $p->text(70,5, "(" . $pn++ . ")");
   
 my $welcome = q{Produced for Omarama based glider pilots to assist safe emergency landings and satisfactory retrieves, this Guide and the associated South Island Gliding Maps (SIGMap) have been nearly 4 years in the making.  Special thanks to Phil Plane, Chris Streat, Chris Rudge, Malcolm Walls and posthumously to Richard Halstead who started it all.  my $welcome = q{Produced for Omarama based glider pilots to assist safe emergency landings and satisfactory retrieves, this Guide and the associated South Island Gliding Maps (SIGMap) have been nearly 4 years in the making.  Special thanks to Phil Plane, Chris Streat, Chris Rudge, Malcolm Walls and posthumously to Richard Halstead who started it all.
Line 512  foreach my $stripnum ( sort keys %{$stri Line 514  foreach my $stripnum ( sort keys %{$stri
   $Text::Wrap::columns = 30;    $Text::Wrap::columns = 30;
   if ( $strips->{strip}->{$stripnum}->{comment} =~ /Danger/ ){    if ( $strips->{strip}->{$stripnum}->{comment} =~ /Danger/ ){
    $p->setcolour("red");     $p->setcolour("red");
      # Draw over image ...
      $p->setlinewidth(4);
      $p->arc( 70, 60, 20, 0, 360);
      $p->line(50,40, 90,80);
   }    }
   my @para = split (/\n/,wrap('', '', $strips->{strip}->{$stripnum}->{comment}));    my @para = split (/\n/,wrap('', '', $strips->{strip}->{$stripnum}->{comment}));
   while (my $ln = shift @para){    while (my $ln = shift @para){
Line 601  foreach my $stripname ( sort keys %strip Line 607  foreach my $stripname ( sort keys %strip
 # write the output to a file  # write the output to a file
 $p->output("gobook.ps");  $p->output("gobook.ps");
   
   # use ghostscript to convert to pdf ...
   `gs -q -dNOPAUSE -dSAFER -dBATCH -sDEVICE=pdfwrite -sOutputFile=gobook.pdf gobook.ps`;
   
 exit 0;  exit 0;
   
 sub startpage {  sub startpage {

Removed from v.1.2  
changed lines
  Added in v.3.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>