in reply to Re: $canvas->postscript method - unexpected result
in thread $canvas->postscript method - unexpected result

I tried what you suggested but I can only print out the items on the top left corner and loose everything below them which are my 3 last items. How come it works for you and not for me?
Maybe it's a problem of my printer, I'm not sure.
Another point is the max height here is 1353 which is larger than my screen (8 i ~ 764 pixels) I suppose, so I think the pageheight option doesn't do its job to scale everything in my screen. That maybe explains why it doesn't work.
I think of using a loop to split my canvas into multiple parts and dump them out accordingly like this :
for (my $i='1'; $i<$maxheight; $i+=850){ ++$currentPage;print "$currentPage\n"; $canvas->postscript('-x'=>'0', '-y'=>$i, -width=>$maxwidth, -height=>850, -colormode=>'color', -file=>"$i.ps", -pageanchor=>'n', -pageheight=>'10.5 i'); system("lpr -S ilfpsc6vs01 -P nw1h305c $i.ps") == 0 or die $!; }
What do you think?
I know it seems goofy. The problem is I have to pipe every single ps file to the printer. I hope there might have a way to do this better.

Replies are listed 'Best First'.
Re^3: $canvas->postscript method - unexpected result
by zentara (Cardinal) on Jun 25, 2008 at 16:17 UTC
    I'm not sure, I don't use postscript too often except to get full output and convert to a graphic like jpg, which I can scale. The pageheight option is supposed to scale things down to the page height (with a consequential width scaling). By experiment, I had to go down to 8 to see it all, even though my screen can handle 10. Maybe you need to experiment or check the settings for your printer..... maybe you have a "letter vs. A4" issue, a "landscape vs portrait issue", or something similar?

    You can always use ImageMagick to convert the full postscript to jpg(png, etc), then scale it to fit your printer's output. Sorry, I'm just not much of a printer expert. ;-(


    I'm not really a human, but I play one on earth CandyGram for Mongo
      thanks for your help.
      I think I gonna try to modify the ps code itself to see how it could be fixed.
      Now if I don't need to scale my output, do you know how to split my ps file into multiple pages?
        Never did it, but this is what I would try. After a bbox('all'), break your your page's @capture settings, and take multiple captures. It might take some ingenuity. :-) You might want to look into some other utilities that paginate large postscript?
        $main->Button( -text => "Save", -command => [sub { $canvas->update; my @capture=(); my ($x0,$y0,$x1,$y1)=$canvas->bbox('all'); @capture=('-x'=>$x0,'-y'=>$y0,-height=>$y1-$y0,-width=>$x1-$x +0); $canvas -> postscript(-colormode=>'color', -file=>$0.'.ps', -rotate=>0, -width=>800, -height=>500, @capture); } ] )->pack;

        I'm not really a human, but I play one on earth CandyGram for Mongo