I can replicate your problem.  Seems you have to explicitly tell PostScript::Simple to not create EPS files (apparently that's the default). I.e.

my $p = new PostScript::Simple(papersize => "A4", colour => 1, eps => 0); # <-- !

EPS files won't have1 a PS showpage command (which tells the PS interpreter to actually print/output the internally rendered page), because they're meant for inclusion in other documents.

GhostScript-derived programs automatically add a showpage if there isn't one already (while real printers do not) — which explains why it does work in that case...

___

1 or, more precisely, they shouldn't normally contain "showpage" — at least that's the theory (in that respect, PostScript::Simple is behaving correctly — what's a bit counter-intuitive, though, is that EPS output is the default...).

In real life, however, many programs do output a showpage even with EPS files - the one you're including does have one, for example - just in case someone wants to print the EPS file stand-alone, i.e. without wrapping it in a regular PS document. For the same reason, programs that include EPS files typically locally redefine the showpage command as a no-op (also done by PostScript::Simple), so the command doesn't cause any problems with the page being printed too early...


In reply to Re: create ps file with PostScript::Simple - cannot print it out? by almut
in thread create ps file with PostScript::Simple - cannot print it out? by cta

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.