New topic: 

Printing help [RESOLVED]

<http://forums.realsoftware.com/viewtopic.php?t=43917>

         Page 1 of 1
   [ 6 posts ]                 Previous topic | Next topic          Author  
Message        rhartz          Post subject: Printing help [RESOLVED]Posted: 
Mon May 07, 2012 3:54 pm                         
Joined: Mon Feb 20, 2012 3:16 pm
Posts: 46                Hi.  I'm trying to use Graphics to print.  I need some 
of the text to be bold and larger font, and other to be smaller font and not 
bold.  Could someone take a look at this?  This is printing, but I do receive 
an error and only the large font bold prints (g, not g2)
dim g, g2 as Graphics

g = OpenPrinter()
g2 = OpenPrinter()

g.Bold = True
g.TextSize = 18
g2.TextSize = 11

g.DrawString "Registration Code", 90, 72
g.DrawString listbox3.Cell(0, 0), 118, 108
g2.DrawString "This code is to be used as your Login & Password when", 36, 144
g2.DrawString "registering.  They are the same and are case sensitive.", 40, 162

g.DrawString "Registration Code", 396, 72
g.DrawString listbox3.Cell(1, 0), 424, 108
g2.DrawString "This code is to be used as your Login & Password when", 324, 144
g2.DrawString "registering.  They are the same and are case sensitive.", 328, 
162
     

    Last edited by rhartz on Mon May 07, 2012 9:04 pm, edited 1 time in total.  
 
                             Top                npalardy          Post subject: 
Re: Printing helpPosted: Mon May 07, 2012 5:31 pm                       Real 
Software Engineer          
Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7225
Location: Canada, Alberta, Near Red Deer                A few details
1) what platform ?
2) what font ?      
_________________
My web site Great White Software
RBLibrary.com REALbasic learning  
                             Top                rhartz          Post subject: 
Re: Printing helpPosted: Mon May 07, 2012 5:35 pm                         
Joined: Mon Feb 20, 2012 3:16 pm
Posts: 46                Sorry.  Windows and whatever font the default is   
                             Top                Bob Keeney          Post 
subject: Re: Printing helpPosted: Mon May 07, 2012 5:59 pm                      
           
Joined: Fri Sep 30, 2005 11:48 am
Posts: 2993
Location: Lenexa, KS                What is the error?

What happens if you do it sequentially?  Meaning you do all of g and then g2?   
   
_________________
Bob K.

30+ hours of Real Studio Video Training (including over 6 hours of Web Edition) 
at http://www.bkeeney.com/
Real Studio Consulting http://www.bkeeney.com/consulting/real-studio-consulting 
     
BKeeney Briefs Blog For Real Studio Developers http://www.bkeeneybriefs.com/  
                             Top                JeremK          Post subject: 
Re: Printing helpPosted: Mon May 07, 2012 6:29 pm                         
Joined: Thu Apr 10, 2008 6:03 am
Posts: 255
Location: Paris-La Défense, France                I don't think using 
Openprinter twice is going to work properly.

You should use this code instead:

dim g as Graphics

g = OpenPrinter()

g.Bold = True
g.TextSize = 18


g.DrawString "Registration Code", 90, 72
g.DrawString listbox3.Cell(0, 0), 118, 108

g.bold = False
g.textSize = 11
g.DrawString "This code is to be used as your Login & Password when", 36, 144
g.DrawString "registering.  They are the same and are case sensitive.", 40, 162

g.Bold = True
g.TextSize = 18
g.DrawString "Registration Code", 396, 72
g.DrawString listbox3.Cell(1, 0), 424, 108

g.bold = False
g.textSize = 11
g.DrawString "This code is to be used as your Login & Password when", 324, 144
g.DrawString "registering.  They are the same and are case sensitive.", 328, 162
      
_________________
Check my Web Page for high quality custom controls and classes (no plugins) for 
Windows, Mac OS and Linux 
REALBasic 2011 R4 on Win 7 & Mac OS X  
                             Top                rhartz          Post subject: 
Re: Printing helpPosted: Mon May 07, 2012 9:04 pm                         
Joined: Mon Feb 20, 2012 3:16 pm
Posts: 46                Bob - The program would crash and gave the error 
message to report to RS

JeremK - That worked!  Thanks for your help!  I was under the assumption that 
the font could be defined only once (and why I had a g and a g2), but as you 
pointed out it may be changed each time needed.  Thanks!   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 6 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to