PostScript-File
view release on metacpan or search on metacpan
lib/PostScript/File.pm view on Meta::CPAN
$fonts .= "% end font encoding\n";
} # end if reencode
# Prepare the PostScript file
my $postscript = $o->{eps} ? "\%!PS-Adobe-3.0 EPSF-3.0\n" : "\%!PS-Adobe-3.0\n";
if ($o->{eps}) {
$postscript .= $o->_bbox_comment('', $o->{bbox});
}
if ($o->{headings}) {
require Sys::Hostname;
my $user = getlogin() || (getpwuid($<))[0] || "Unknown";
my $hostname = Sys::Hostname::hostname();
$postscript .= $o->_here_doc(<<END_TITLES);
\%\%For: $user\@$hostname
\%\%Creator: Perl module ${\( ref $o )} v$PostScript::File::VERSION
\%\%CreationDate: ${\( scalar localtime )}
END_TITLES
$postscript .= $o->_here_doc(<<END_PS_ONLY) if (not $o->{eps});
\%\%DocumentMedia: $o->{paper} $o->{width} $o->{height} 80 ( ) ( )
END_PS_ONLY
}
lib/PostScript/File.pm view on Meta::CPAN
}
}
return $filename;
}
sub check_tilde ($) { ## no critic (ProhibitSubroutinePrototypes)
my ($dir) = @_;
$dir = "" unless defined $dir;
$dir =~ s{^~([^/]*)}{$1 ? (getpwnam($1))[7] : ($ENV{HOME} || $ENV{LOGDIR} || (getpwuid($>))[7]) }ex;
return $dir;
}
sub array_as_string (@) { ## no critic (ProhibitSubroutinePrototypes)
my $array = "[ ";
foreach my $f (@_) { $array .= "$f "; }
$array .= "]";
return $array;
}
lib/PostScript/File.pm view on Meta::CPAN
If true, add PostScript DSC comments recording the date of creation and user's
name. (Default: false)
The comments inserted when C<headings> is true are:
%%For: USER@HOSTNAME
%%Creator: Perl module PostScript::File v2.23
%%CreationDate: Sun Jan 1 00:00:00 2012
%%DocumentMedia: US-Letter 612 792 80 ( ) ( )
USER comes from C<getlogin() || getpwuid($<)>, and HOSTNAME comes from
L<Sys::Hostname>. The DocumentMedia values come from the
L<paper size attributes|/"Paper Size and Margins">. The
DocumentMedia comment is omitted from EPS files.
If you want different values, leave C<headings> false and use
L</add_comment> to add whatever you want.
=head4 reencode
Requests that a font re-encode function be added and that the fonts
( run in 0.321 second using v1.01-cache-2.11-cpan-8d75d55dd25 )