--- gobook.perl 2013/11/23 02:57:44 1.5 +++ gobook.perl 2017/02/01 05:39:20 3.3 @@ -1,4 +1,5 @@ #! /usr/bin/perl -w +# $Id: gobook.perl,v 3.3 2017/02/01 05:39:20 philip Exp $ use XML::Simple; use strict; use PostScript::Simple; @@ -12,11 +13,12 @@ if ( defined $xml ){ $strips = XMLin($xml, KeyAttr => {strip => 'id'}); } -# create a new PostScript object -my $p = new PostScript::Simple(papersize => "A5", - colour => 1, - eps => 0, - units => "mm",); +# create a new PostScript object; + +my $p = new PostScript::Simple(papersize => "A5", + colour => 1, + eps => 0, + units => "mm"); # co-ords are horizontal, vertical. from bottom left corner. 148 x 210 @@ -53,7 +55,7 @@ $p->setcolour(60,28,0); $p->text(35,175, "Land-Out Guide"); $p->setfont("Helvetica", 17); $p->setcolour("white"); -$p->text(12,52, "3rd Edition 2013"); +$p->text(12,52, "5th Edition 2017"); $p->newpage; # Contents @@ -96,11 +98,9 @@ $p->text($t1,$v, "Text by Phil Plane and $v -= $ls; $p->text($t1,$v, "Copyright GlideOmarama.com 2013."); $v -= $ls; -$p->text($t1,$v, "First Edition published November 2007. "); -$v -= $ls; -$p->text($t1,$v, "Second Edition published November 2008. "); +$p->text($t1,$v, "First Edition published November 2007."); $v -= $ls; -$p->text($t1,$v, "Third Edition published November 2013. "); +$p->text($t1,$v, "Fifth Edition published February 2017."); $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. @@ -487,7 +487,7 @@ foreach my $stripnum ( sort keys %{$stri else { $p->setcolour(255,54,0); # Glide Omarama Orange $p->setfont("Helvetica", 32); - $p->text({rotate => 45}, $t2 ,20, 'Details in next edition' ); + $p->text({rotate => 45}, $t2 ,20, 'No picture yet' ); $p->setcolour("black"); } my $v = 185; @@ -605,6 +605,9 @@ foreach my $stripname ( sort keys %strip # write the output to a file $p->output("gobook.ps"); +# use ghostscript to convert to pdf ... +`gs -q -dNOPAUSE -dSAFER -dBATCH -sDEVICE=pdfwrite -sOutputFile=gobook.pdf gobook.ps`; + exit 0; sub startpage {