Bug #2087 - an enhancement request, "PRINT@"

Richard Gaskin ambassador at fourthworld.com
Sat Aug 28 17:11:11 EDT 2004


Frank D. Engel, Jr. wrote:

 >> What are the advantages of creating an alternate way to draw text
 >> containers and graphic primitives over the current object-based
 >> methods?
 >
 > Greater control over position on the page; this is made more
 > significant when considering the "PRINT @" command suggested here,
 > since it would allow for more precise underlining of headers and
 > so forth (even if the PRINT @ has underlining, you would be
 > underlining the text, not placing a separator for the header itself).

Unless Rev migrates to a resolution-independent coordinate system, all 
printing would be specified in pixels, whether as objects or an 
alternative script-only solution.

 > Plus I have extreme difficulty figuring out how to effectively use the
 > current printing options....

Like most things in Rev, printing is handled in a unique manner that's 
not hard to use well once you get the hang of it.

Basically you create an invisible stack to use as a "printing port", lay 
out objects, and issue a "print card" command.

Using "open printing" before print commands and "close printing" 
afterward lets you issue multiple print commands in a single print job.

Using "open printing with dialog" presents the OS print job dialog, and 
"answer printer" brings up the OS Page Setup dialog.

Filter the Transcript Dictionary with "print" to get a list of printing 
properties which may be useful, including printScale, printPaperSize, 
printGutters, printMargins, and more.

Key to printing a multi-page block of text is the pageHeights property. 
    You put text into a field of the width you'll be printing, get the 
pageHeights of that field, and what you have is a list of integers which 
are the amount you'd need to scroll the field to advance one page's worth.

While this sort of scroll,print,repeat may seem compicated, it's not bad 
once you actually do it, and not much more complicated than what you'd 
have to do do manage multi-page columns with headers, footers, etc. with 
a PRINT @ command.

But using the existing object model to lay out printing gives you the 
full range of Rev objects to use, including vector and raster graphics 
in addition to fields, and even buttons if you need 'em.

And best of all you can do it today, without needing to wait to anyone 
to add anything to the engine.

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com



More information about the use-livecode mailing list