🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.postscript
6 messages
6 total messages Started by SW International Sat, 19 Dec 1992 15:55
Break down drawing larger than pagesize ?
#5985
Author: SW International
Date: Sat, 19 Dec 1992 15:55
23 lines
1532 bytes
Has anyone ever done a program (be it postscript or a tool creating
postscript), that can draw on an (infinitely large) virtual page, then
break it down into an acceptable size (say the printer's default),
print all pages with special markings on the borders on how to paste
it back together, and maybe print one more page showing an overview
of the whole mess?

Would that be possible in PS? Could this be installe in a way that another
postscript program, unaware of it, finds a big virtual page to draw on,
with this gem then doing the translation?

Just thinking, would sure be nice...

Mathias
PS: I don't know much postscript myself, so tell me if this is just
a dream...
--
SW International Systems Pte Ltd     |  "I've got a plan so cunning 
    14, Science Park Drive           | you could put a tail on it and
    Singapore Science Park           | call it a weasel".. Black Adder
    Singapore 0511                   | 
    Tel: (65) 778-0066               |
    Fax: (65) 777-9401               | swispl@solomon.technet.sg
Re: Break down drawing larger than pagesize ?
#5801
Author: Vance Bass
Date: Mon, 21 Dec 1992 16:37
22 lines
1633 bytes
In article <BzIK8M.6yB@newsserver.technet.sg> swispl@solomon.technet.sg (SW International) writes:
>Has anyone ever done a program (be it postscript or a tool creating
>postscript), that can draw on an (infinitely large) virtual page, then
>break it down into an acceptable size (say the printer's default),
>print all pages with special markings on the borders on how to paste
>it back together, and maybe print one more page showing an overview
>of the whole mess?

Although it's not precisely what you request, there is a program in the
Adobe Tutorial/Cookbook ("Blue Book") which takes a PostScript space and
prints it on multiple smaller sheets, suitable for pasting together.

Sounds like you want something generically applicable, and this refers to
a specific page size, but it's not far off, and if you read the book you'll
know how to modify it :-)

Vance
-- 
+----------------------------------------------------------------------+        
Vance Bass			  Reply-to: vrbass@atlvmic1.vnet.ibm.com     
IBM Professional Services	I work for IBM.  My opinions are my own.
Nashville, TN				 The facts speak for themselves.
Re: Break down drawing larger than pagesize ?
#5802
Author: Jonathan Monsarrat
Date: Mon, 21 Dec 1992 17:12
45 lines
2137 bytes
>Has anyone ever done a program (be it postscript or a tool creating
>postscript), that can draw on an (infinitely large) virtual page, then
>break it down into an acceptable size (say the printer's default),

Here's a hack that may be of use to you. I've used it to create
posters 18 feet high! :)

Right now it's set to print "normal size" -- just one page.

-Jon


%! Jon Monsarrat   jgm@cs.brown.edu   Brown University %! Obfuscated PostScript
% The "Drawit" routine can be any program. Ignore the complexity of
% what drawit happens to be defined as.
/drawit
{

4 4 scale

(LcHdBidZi_hdQ6[PaVa1b4c6F"J4b/>$O<)(di_zk{:UFfUg;ABF)(2n>]Eh:u?<)(P"M#R\(:$T<)
([gXfSZ]f\\dZbeZeb^fH;`?dR=ZS7)(K P!U!: H<)(9l9cCf:o?$)(7W4]6`:X;=)(U"W#_%:"R-)
(A 5"<&Y%K"F"M,M,S\)i3e.M5F_PZR9>lP-)(wBxEuEs7x;uBq:q<q>hFh7o:=Nj<)(Z#]#b#:$R-)
(m+m+k3S!R+d,;"^<)(GFP\\RamZf;TAP{X{fd<{C7)(4840N2:6N=)([ Z#^&:!c<)(<%?$C$:#8<)
(D!J"L#:!B<)/a{def}def/M{exch}a/S{repeat}a/Q{{40 add}if}a 18{{}forall/R M a/x 2
/y 3/z 5 3{R M mod 1 eq a}S x Q M y Q moveto 57 sub{3{y Q M x Q M 6 2 roll}S
curveto}S z{fill}{stroke}ifelse}S showpage

} bind def

/size 1 def   % change this variable to get larger posters.
              % For example, try numbers 2, 3 and 4.
/inch { 72 mul } def
% This defines the size of the poster. The output will be (size+1)^2
% number of pages, so be wary of printing this out too big. It take a
% long time.

0 1 size 11 17 div mul { /height exch def
        0 1 size 8.5 11 div mul { /width exch def
                  -10.5 inch width mul
                  -16.5 inch height mul translate
                   size size scale drawit
              } for
      } for
Re: Break down drawing larger than pagesize ?
#5812
Author: Bill Lee
Date: Tue, 22 Dec 1992 02:53
44 lines
2124 bytes
In article <1992Dec21.171203.29295@cs.brown.edu> jgm@cs.brown.edu (Jonathan Monsarrat) writes:
>
>>Has anyone ever done a program (be it postscript or a tool creating
>>postscript), that can draw on an (infinitely large) virtual page, then
>>break it down into an acceptable size (say the printer's default),
>
>Here's a hack that may be of use to you. I've used it to create
>posters 18 feet high! :)
>
>Right now it's set to print "normal size" -- just one page.
>
>-Jon
>
	(Another of Jon's Obfuscated PostScript figures deleted) 8-{)


Has anybody been able to answer this question in general?

I do not believe this can be done in most PostScript interpreters for an
ARBITRARY image. 

The basic premise of the example in the Blue Book is to build a procedure
that captures the page's imaging code, then repetitively translate
the origin around and re-image the entire picture but only printing
a single page-worth of it.

Obviously this works. That is until the PostScript code which represents
the image gets so large that it overflows the stack, or some other 
implementation limit is reached. Then it DOESN'T work.

My own experience is exactly as described. I was trying to tile a picture
generated by Cadre TeamWork but the image was bigger than the stack could
hold to create the procedure. I had to resort to a program to read the
PostScript code and break it up into many (50-100) smaller procedures, and 
then re-image for each translate position. 

Yes, this worked. But it took explicit knowledge of the PS emitted by TeamWork.
Not applicable to an ARBITRARY piece of PS code.

Comments???

Regards,

Bill Lee
Re: Break down drawing larger than pagesize ?
#5815
Author: Jonathan Monsarrat
Date: Tue, 22 Dec 1992 14:25
74 lines
3620 bytes

> Has anybody been able to answer this question in general?

My answer would have been more general if I had used the "save"
and "restore" operators, which can literally wipe all changes to 
memory since the save.

Then it wouldn't matter whether your algorithm uses tons of memory.
This should work on arbitrary pieces of code. Really!

OOPS: My last posted code assumed that you had 11x17 inch paper. 
      At the top of this is a hack to let you set 11x17 if you have it.

-Jon

% example-multipage.ps 
% PostScript Quickie by Jon Monsarrat 1992 jgm@cs.brown.edu
%%%%%%%%%%%  Use the below code to get 11"x17" paper %%%%%%%%%%%%%
%/Pwid 792 def         % page width
%/Pht 1224 def         % page height
%/Margin 23 def                % border margin
%/Clw 15 def           % max-traffic line width
%Pht 792 gt
%    {statusdict /11x17tray known {
%      statusdict begin 11x17tray end
%    }{
%      statusdict /setpageparams known {
%          11 72 mul 17 72 mul 36 1    % w h offs. orientation
%          statusdict begin setpageparams end
%      }{
%          11 17 div dup scale         % for laserwriter
%      } ifelse
%    } ifelse
%  } if

%%%%%%%%%%%%%%%%%% definition of drawit (can be anything) %%%%%%%%%%%%%%%

/drawit    % ignore the complexity of this image. It can be anything.
{

(LcHdBidZi_hdQ6[PaVa1b4c6F"J4b/>$O<)(di_zk{:UFfUg;ABF)(2n>]Eh:u?<)(P"M#R\(:$T<)
([gXfSZ]f\\dZbeZeb^fH;`?dR=ZS7)(K P!U!: H<)(9l9cCf:o?$)(7W4]6`:X;=)(U"W#_%:"R-)
(A 5"<&Y%K"F"M,M,S\)i3e.M5F_PZR9>lP-)(wBxEuEs7x;uBq:q<q>hFh7o:=Nj<)(Z#]#b#:$R-)
(m+m+k3S!R+d,;"^<)(GFP\\RamZf;TAP{X{fd<{C7)(4840N2:6N=)([ Z#^&:!c<)(<%?$C$:#8<)
(D!J"L#:!B<)/a{def}def/M{exch}a/S{repeat}a/Q{{40 add}if}a 18{{}forall/R M a/x 2
/y 3/z 5 3{R M mod 1 eq a}S x Q M y Q moveto 57 sub{3{y Q M x Q M 6 2 roll}S
curveto}S z{fill}{stroke}ifelse}S showpage    % include the showpage!

} bind def

%%%%%%%%%%% Here's some more versatile code %%%%%%%%%%%%

/inch {72 mul} def
/size 6 def     % How much to scale the picture?
% This defines the size of the poster. The output will be scaled to
% approximately (size+1)^2 number of pages for a page-sized image,
% so be wary of printing this out too big. It take a long time.

/virtualh 2.5 def     % The unscaled snoopy fits on an 2.5" height
/virtualw 2.2 def     % The unscaled snoopy fits on an 2.2" width
/actualh 11 def       % The physical pages being printed on are 11" height
/actualw 8.5 def      % The physical pages being printed on are 8.5" width

0 1 size virtualh actualh div mul { /height exch def
        0 1 size virtualw actualw div mul { /width exch def
                   save        % Take a snapshot of memory state
                       -1 actualw mul .5 add inch width mul
                       -1 actualh mul .5 add inch height mul translate
                       size size scale
                       drawit
                   restore     % completely restore the memory
              } for
      } for
Re: Break down drawing larger than pagesize ?
#5818
Author: Rainer Pruy
Date: Tue, 22 Dec 1992 17:21
89 lines
4888 bytes
In <1992Dec22.025320.5909@leeweyr.sccsi.com> bill@leeweyr.sccsi.com (Bill Lee) writes:

> In article <1992Dec21.171203.29295@cs.brown.edu> jgm@cs.brown.edu (Jonathan Monsarrat) writes:
> >
> >>Has anyone ever done a program (be it postscript or a tool creating
> >>postscript), that can draw on an (infinitely large) virtual page, then
> >>break it down into an acceptable size (say the printer's default),
> >
> >Here's a hack that may be of use to you. I've used it to create
> >posters 18 feet high! :)
> >
> >Right now it's set to print "normal size" -- just one page.
> >
> >-Jon
> >
> 	(Another of Jon's Obfuscated PostScript figures deleted) 8-{)


> Has anybody been able to answer this question in general?

> I do not believe this can be done in most PostScript interpreters for an
> ARBITRARY image. 

[...observation regarding problems of blue book poster code deleted...]

> Comments???

> Regards,

> Bill Lee

Not for arbitray images, but for most images. It is clearly impossible for
wierd resolution dependent images. For deterministic device independent images
'posterization' is just a matter of (disk) space and (communication) time.

The key idea is to avoid creating a procedure at all.

Yes, using a procedure, as is suggested in the blue book, has space and time 
benefits.  In level 2 PS such a procedure could be defined as PaintProc of a
forms dict and the forms cache will probably speed up processing.

For complex page descriptions, as Bill noted, defining a procedure
might fail due to implementation restrictions.

However, one does not need to define a procedure. Just repeat the page
description itself each time prefixed with necessary CTM modification commands
as suggested in the blue book example.

The only difficulty arises with page desriptions using device or page setup
commands (A4, letter, pagedim, initgraphics, init... et al.), which would
interfere with the CTM modifications necessary for producing individual
poster sheets.

With such PS code there are two possibilities:
  - commenting out the 'bad' commands 
    either by special casing several products (needs knowledge of all products
    producing postcript code posters should be made from) or by providing
    'emulations' for all critical commands (requires kowledge of postscript in
    general and probably some undocumented, product (printer) dependent
    operators in systemdict or serverdict (For many software products red book
    documented operators will suffice, but I don't know what device dependencies
    hide inside the LaserPrep prologue of Adobe.)

  - inserting poster CTM modifications AFTER all such 'bad' commands
    This is trivial for DSC compliant code. Insert 'poster code' just at the end
    of each 'page setup' section, just before '%%EndPageSetup', or, if this DSC
    comment is not used, just after the '%%Page:' comment.

Repeating a page description allows for producing a poster form a page
description, as long as the printer used already was able to print the
plain page.

Regards,
Rainer Pruy

 /----------------------------------------------------------------------------\
 | Rainer Pruy           | email:                                             |
 |                       |  DOMAIN: pruy@informatik.uni-erlangen.de           |
 | Friedrich-Alexander   |  X400:   /C=de/A=dbp/P=uni-erlangen/OU=informatik/ |
 | Universitaet          |          /S=Pruy/G=Rainer/                         |
 |                       |  UUCP:   ...!uunet!fauern!pruy                     |
 | CS Department IMMD IV |----------------------------------------------------|
 | (operating systems)   | phone:  +49 9131 85-7909                           |
 |                       |----------------------------------------------------|
 | Martensstrasse 1      | ================================================== |
 |                       |//   Programming Department:                      \\|
 | D-8520 Erlangen       |\\           Mistakes made while you wait         //|
 | West Germany          | ================================================== |
 \----------------------------------------------------------------------------/
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads