The Perl Advent Calendar needs more articles for 2022. Submit your idea today!

=head1 NAME

examples/ - A prima PostScript printer output setup program.


Prints a PS document after setup dialog is finished.

Whereas Prima::PS modules can be used on any platform,
they serve as an only remedy on *nix systems when printing
via Prima is desired. The Prima::PS interface can load user
preferences from $HOME/.prima/printer file. This file is
maintained by the PostScript output setup dialog.


use strict;
use warnings;
use Prima;
use Prima::PS::Printer;
use Prima::Application;
use Prima::StdBitmap;

if (!@ARGV || $ARGV[0] !~ /^\-(ps|pdf)$/) {
	print "Please run with either -ps or -pdf\n";

$::application-> icon( Prima::StdBitmap::icon(0));

my $class = ($ARGV[0] eq '-ps') ?
	'Prima::PS::Printer' :

my $x = $class-> new;
$x-> setup_dialog;

$x-> begin_doc;
$x-> color(cl::Green);
$x-> font-> size(100);
$x-> text_out( "Hello world!", 100, 100);
$x-> end_doc;