Printing Styled Text and Graphics
Issue: 7.4 (May/June 2009)
Author: Tom Baumgartner
Article Description: No description available.
Article Length (in bytes): 11,604
Starting Page Number: 20
RBD Number: 7410
7410.zip Updated: Friday, May 1, 2009 at 11:36 AM
Related Link(s): None
Known Limitations: None
Excerpt of article text...
Writing your first REALbasic program that prints only from the Mac is both a blessing and a curse. It is a blessing because printing from the Mac works basically as you expect. It is a curse because, when you port the program to Windows, you find that printing is not straightforward. Both text and graphics will be smaller than you expect and spacing will be incorrect. The REALbasic documentation regarding printing of graphics is not as helpful as it should be. This article discusses the issues and presents one method of writing a cross-platform program that prints styled text and graphics.
Our example project is based on a project I created for myself when I wanted to print four-up postcards (the same design four times on a letter-sized page). The program has a main window in which the user will enter their styled text into an EditField and the user can put a picture into a movable imageWell as shown in Figure 1. (The same functionality could be achieved by drawing the user's typed input on a canvas but implementing a text editor in a canvas is extremely complex.) The text and picture are then printed four times in the four quadrants of an 8.5 by 11 inch page (see printout results in Figure 2). Seems simple, but let's start digging into the details.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.