Well, we ended up crafting our own text wrapping methods using the
graphics methods like drawstring, stringwidth etc.
The PrintClass->method we created calculates where text wrapping
should be for each line, and if the next line would print past the
end of the page ( as defined by the printersetup), then we do a
g.nextpage, start text yPos at 0 and start drawing text on the new page.
Only took a couple of hours and it's working.
It would have been easier if DrawBlock wasn't broken and
StyledTextPrinter was more versatile.
Jay Wooten, President
Go Data Systems, Inc.
www.godatasystems.com
[EMAIL PROTECTED]
On May 8, 2006, at 5:32 PM, Charles Yeomans wrote:
Unfortunately, it's not really possible to print any but the
simplest paged documents using StyledTextPrinter.
Charles Yeomans
On May 8, 2006, at 4:22 PM, Jay Wooten wrote:
Hmm, it seems that the alignment functionality of Drawblock and
StyledTextPrinter is broken on the Mac.
Here's a bug report dating back to 2002 with 20 requests.
http://www.realsoftware.com/feedback/viewreport.php?reportid=fszgmdiw
and some from 2005 with 13 feedback requests.
http://www.realsoftware.com/feedback/viewreport.php?reportid=wrdxfrev
Here's another with 4 more request
http://www.realsoftware.com/feedback/viewreport.php?reportid=sboyfhtj
Must be a really nasty bug to take > 4 years to fix (grin grin,
wink wink, nudge nudge)
- Jay
On May 8, 2006, at 10:17 AM, Charles Yeomans wrote:
On May 8, 2006, at 8:27 AM, Jay Wooten wrote:
We are updating the printing capabilities of our app. Up to now,
all the reports it generated were left justified, simple
reports. Now our users want alignment, font and text size
capabilities.
So we started looking at the StyledTextPrinter and DrawBlock
methods and found that the DrawBlock doesn't support alignment
(???)
Is that true? If not, then how the heck do you center, right
align text?
So then we thought about doing something with DrawString of a
graphics object - which we have working and have been using.
However we run into an issue when we have a long string of text
(i.e. needs to wrap) that we want centered, and it appears at
the bottom of a printed page, where some of the text is one page
1, and the remainder would be on page two.
The g.drawstring(s, x, y, wrapwidth) is simple enough, but how
do split the text into multiple lines so you can move the lines
onto the next page if necessary.
It's early and I haven't had my coffee yet, so I am probably
overlooking the obvious.
It's not obvious. I've sunk a lot of time into writing classes
to do printing. Page-breaking is especially tricky. What I've
done is to write a DocumentRenderer class, plus several
supporting classes, to handle text layout. Eventually it may all
become an RBD article when I can find some time.
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>