What is the resolution of the printer? At 600dpi, or even 300dpi, 12 point text is awfully small. I don't use StyledTextPrinter, so I don't whether it handles this for you, but for most printing on Windows, you have to scale your font and coordinates based on the printer resolution vs. RB's internal 72dpi.
Tim > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > Roger Meier > Sent: Saturday, April 14, 2007 12:18 PM > To: REALbasic NUG > Subject: StyledTextPrinter on Mac and Windows - Bug or stupidity > > > This one has been driving me nuts all week. I have some code to > print stuff > that works fine on the Mac but not on Windows. I don't know if I stumbled > onto a bug or if I'm doing something stupid. My app prints the contents of > an EditField via its StyledTextPrinter method, followed by a > bunch of other > stuff printed via g.DrawString and g.DrawLine. While it works on the Mac, > the stuff following the Editfield contents are not printed > properly. If the > Editfield contents are not printed, the other stuff prints just fine. > > I was able to replicate the problem in a small example project, and I'd > appreciate it if someone working on windows can confirm what I'm seeing. > > To replicate the problem, create a new project and add an EditField > (multiline property = true) and a push button. Add the following > code to the > action event of the pushbutton: > > > Dim stp as StyledTextPrinter > Dim g as Graphics > g= OpenPrinterDialog() > If g <> Nil then > ' Print via StyledTextPrinter > stp=EditField1.StyledTextPrinter(g,72*7.5) > stp.DrawBlock 40,40,150 > > ' Print via DrawString > g.TextSize = 12 > g.TextFont = "System" > g.ForeColor = &c000000 > g.DrawString("This is printed via g.DrawString", 40, 200) > End if > > When you run the program, add a line or two of text to the editfield and > press the pushbutton. It is supposed to print the the editfield contents > followed by "This is printed via g.DrawString" a little further down. This > works absolutely fine on the Mac. On the PC, however, only the EditField > contents are printed properly. The string that is printed via g.DrawString > appears in the top left corner of the page in a very small size, too small > to read. Furthermore, if the line > stp.DrawBlock 40,40,150 > is commented to avoid the Editfield contents from being printed, > the string > printed via g.DrawString is printed just fine the way it should. > > Can someone think of a reason for this? > > > _______________________________________________ > Unsubscribe or switch delivery mode: > <http://www.realsoftware.com/support/listmanager/> > > Search the archives: > <http://support.realsoftware.com/listarchives/lists.html> > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 269.4.0/760 - Release Date: > 4/13/2007 8:04 PM > -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.4.0/760 - Release Date: 4/13/2007 8:04 PM _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
