hmmm I'm having a problem with dumping my TK canvas to a postscript file. The ps file has data that Ghostscript can't interpret but I'm unsure what is causing this. One example is 0.000 0.000 0.000 setrgbcolor AdjustColor The term AdjustColor is not recognised but I have no idea what causes it to be created.

Has anyone else had problems creating a ps? Any ideas? Any help is appreciated.

Below is more specific info.

My platform: Linux What I'm using: use Tk; use Class::Struct; use POSIX; My Canvas: my $c = $mw -> Scrolled("Canvas", -cursor =>"crosshair") -> pack(-side => "left", -fill => 'both', -expand =>1); my $canvas = $c->Subwidget("canvas"); The Call: $canvas->postscript( -colormode => "mono", -fontmap=>"-*-Helvetica-Bold-0-Normal--*-140-*", -height =>5, -pageanchor => "center", -pageheight => 5, -pagewidth => 5, -pagex => 5, -pagey=>5, -rotate => 0, -width =>5, -x=>0, -y=>0, -file => "file.ps"); The result: %!PS-Adobe-3.0 EPSF-3.0 %%Creator: Tk Canvas Widget %%Title: Window .frame1.canvas %%CreationDate: Tue Dec 17 14:35:31 2002 %%BoundingBox: 3 3 9 9 %%Pages: 1 %%DocumentData: Clean7Bit %%Orientation: Portrait %%EndComments %%BeginSetup /CL 0 def %%EndSetup %%Page: 1 1 save 5.0 5.0 translate 1 1 scale -2 -2 translate 0 5 moveto 5 5 lineto 5 0 lineto 0 0 lineto closepath clip newpath gsave -160 165 moveto 6320 0 rlineto 0 -18320 rlineto -6320 0 rlineto clos +epath 0 setlinejoin 2 setlinecap 2 setlinewidth [] 0 setdash 0.000 0.000 0.000 setrgbcolor AdjustColor stroke grestore restore showpage %%Trailer end %%EOF

update (broquaint): moved <code> tags and added formatting


In reply to tk canvas to postscript error by TooNewbie

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.