More questions regarding revPrintText II
Rob Cozens
rcozens at pon.net
Tue May 28 13:03:00 EDT 2002
Hi Again,
I'm now at:
on printTable
theTable,theHeader,theFontSize,theLineLength,addedSpaceWidth,addedSpaceLocations
if theLineLength < 1 then put offset(return,theTable)-1 into theLineLength
set cursor to watch
push card
lock screen
lock messages
go to card 1 of stack "Serendipity Library.rev"
if addedSpaceWidth is not empty then put justifyString("
",addedSpaceWidth) into theSpacer
put empty into newTable
repeat for each line tableLine in theTable
put char 1 to theLineLength of tableLine into tableLine --
truncate unwanted or hidden text
if addedSpaceWidth > 0 then
repeat with x = the number of lines of addedSpaceLocations down to 1
put theSpacer after char (line x of addedSpaceLocations) of tableLine
end repeat
end if
put tableLine&return after newTable
end repeat
put newTable into field "Print Formatter"
set the textFont of char 1 to -1 of field "Print Formatter" to "Courier New"
-- set the textAlign of char 1 to -1 of field "Print Formatter" to "Center"
set the textSize of char 1 to -1 of field "Print Formatter" to theFontSize
set the printMargins to 36,36,36,36
revShowPrintDialog true,true
get the short date
revPrintText (the htmlText of field "Print
Formatter"),"<p>"&it&"</p>"&tab&"<p><b>"&theHeader&"</b><p>",tab&"<p><%pagenumber%></p>"
put empty into field "Print Formatter"
pop card
unlock messages
unlock screen
set cursor to hand
end printTable
The issues I still need to resolve are:
1. How to get the text center aligned? (The line I commented out
produces a can't set that property error, and I've noticed one cannot
manually set the alignment of a single line in a field: the whole
field changes alignment; yet I know this can be done in html...what
happens when that html is placed in the htmlText of a field?)
2. How to get revPrintText to recognize changed print margins when
determining lines per page? Changing all four printMargins seemed
only to effect the right margin. revPrintText inserts a page break
several lines above the footer, leaving too much blank space.
3. I thought setting font & size for the header & footer would be
easy; but I'm not getting anywhere there either. According to the
Rev dictionary, "If the textToPrint, headerText, or footerText
contains <p> or a start/end tag pair, the revPrintText command
assumes the text is in the same format as the htmlText property."
Thus I assumed the "<p>"s above would instruct revPrintText to use
the font & size specified in the htmlText of the field; but it isn't
working.
--
Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.com/who.htm
"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."
from "The Triple Foole" by John Donne (1572-1631)
More information about the use-livecode
mailing list