[Done] Printer bug in V4.40
-
- User
- Posts: 80
- Joined: Tue Jan 12, 2010 4:56 pm
[Done] Printer bug in V4.40
This little program works fine with PB version 4.31 (windows x86, windows xp and windows 7), but it doesn't with version 4.40:
; ---------------------------------------------------------
Define printer.l
LoadFont(0,"Courier New",48)
printer=PrintRequester()
If StartPrinting("Document")
If StartDrawing(PrinterOutput())
DrawingFont(FontID(0))
DrawText(100,100,"PB4.40 (Windows X86) doesn't print this text, just a black rectangle")
DrawText(100,100,"However, PB4.31 works fine. Must be a bug in V4.40.")
StopDrawing()
StopPrinting()
EndIf
EndIf
; ---------------------------------------------------------
Independent of the printer or the operating system, version 4.40 just prints a black rectangle.
; ---------------------------------------------------------
Define printer.l
LoadFont(0,"Courier New",48)
printer=PrintRequester()
If StartPrinting("Document")
If StartDrawing(PrinterOutput())
DrawingFont(FontID(0))
DrawText(100,100,"PB4.40 (Windows X86) doesn't print this text, just a black rectangle")
DrawText(100,100,"However, PB4.31 works fine. Must be a bug in V4.40.")
StopDrawing()
StopPrinting()
EndIf
EndIf
; ---------------------------------------------------------
Independent of the printer or the operating system, version 4.40 just prints a black rectangle.
Re: Printer bug in V4.40
....seems like the default backcolor is black, 'cause this works:
Code: Select all
Define printer.l
LoadFont(0,"Courier New",48)
printer=PrintRequester()
If StartPrinting("Document")
If StartDrawing(PrinterOutput())
BackColor(#White)
DrawingFont(FontID(0))
DrawText(100,100,"PB4.40 (Windows X86) doesn't print this text, just a black rectangle")
DrawText(100,100,"However, PB4.31 works fine. Must be a bug in V4.40.")
StopDrawing()
EndIf
StopPrinting()
EndIf
PureBasic for Windows
-
- User
- Posts: 80
- Joined: Tue Jan 12, 2010 4:56 pm
Re: Printer bug in V4.40
Cool, you are right, that's the solution. Thanks a lot!
- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
Re: Printer bug in V4.40
ABBKlaus also has written a few interesting tools to help with printer use: http://www.purebasicpower.de/?PrinterLib
I use this in my application! It is incredibly helpful!
I use this in my application! It is incredibly helpful!

Re: Printer bug in V4.40
So, does anyone know why this would have changed from version 4.3 to version 4.4? Seems to me that, for a printer anyway, the default backcolor should always be assumed white 

Missed it by that much!!
HK
HK
- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
Re: Printer bug in V4.40
The actual change log is probably somewhere in the PB website but in PB4.4 you see this:
Result = DrawText(x, y, Text$ [, FrontColor [, BackColor]])
Same as 4.3
WOW that was incredibally unhelpful... sorry...
(I really though it would be different since the notices about the remod of the draw system have been all over!)
I can only assume the system populated frontcolro as black since that would be a 0 value and backcolor as 0 since likewise that would be a 0 value and if you do not specify any value those are set at 0 as a default.
Result = DrawText(x, y, Text$ [, FrontColor [, BackColor]])
Same as 4.3
WOW that was incredibally unhelpful... sorry...
(I really though it would be different since the notices about the remod of the draw system have been all over!)

I can only assume the system populated frontcolro as black since that would be a 0 value and backcolor as 0 since likewise that would be a 0 value and if you do not specify any value those are set at 0 as a default.
Re: Printer bug in V4.40
That's probably a safe assumption, or it'll be something of that nature. The problem comes in where old code gets broken with the update to a new version. Silly stuff like this can take hours to find and debug.
Anyway, I know it's a lot of work for the development team and I do appreciate it, but stuff gets really frustrating.
/rant
I think it wise to stick to ABBKlaus' PrinterLib for printing.
Anyway, I know it's a lot of work for the development team and I do appreciate it, but stuff gets really frustrating.
/rant
I think it wise to stick to ABBKlaus' PrinterLib for printing.
Missed it by that much!!
HK
HK
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Printer bug in V4.40
2DDrawing is completely overhauled for v4.40. Here is the relevant doc:
PB Doc for DrawingMode() wrote: #PB_2DDrawing_Transparent
If this flag is set then the background will be transparent with the DrawText() command
BERESHEIT
Re: Printer bug in V4.40
Thanks.
I understand the complete overhaul part, and I did not intend to throw stones at the development team. It is clear to me that changing something of this magnitude is not accomplished without a great deal of effort on their part. It would have been great if it could have been done without breaking existing code, but I understand that this is not always easy or even possible, and sometimes things just get overlooked. Such is life I suppose.
Setting the transparent flag should avoid trouble for printing then. 
I understand the complete overhaul part, and I did not intend to throw stones at the development team. It is clear to me that changing something of this magnitude is not accomplished without a great deal of effort on their part. It would have been great if it could have been done without breaking existing code, but I understand that this is not always easy or even possible, and sometimes things just get overlooked. Such is life I suppose.


Missed it by that much!!
HK
HK
Re: Printer bug in V4.40
From what I understand, historically the backcolor was always supposed to be black, it just had been left uncorrected for so long (I was unable to find a source quote to confirm this).harkon wrote:So, does anyone know why this would have changed from version 4.3 to version 4.4? Seems to me that, for a printer anyway, the default backcolor should always be assumed white
-
- Addict
- Posts: 4791
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Printer bug in V4.40
I just stumbled across the same problem.
Regards, Little John
Wouldn't it be better to make #PB_2DDrawing_Transparent the default background setting for DrawText()? I think this is what most people probably are expecting intuitively.netmaestro wrote:2DDrawing is completely overhauled for v4.40. Here is the relevant doc:
PB Doc for DrawingMode() wrote: #PB_2DDrawing_Transparent
If this flag is set then the background will be transparent with the DrawText() command
Regards, Little John
Re: [Done] Printer bug in V4.40
Fixed means in this case... ?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
Re: [Done] Printer bug in V4.40
The default FrontColor is now white, as it is with the other subsystems.
quidquid Latine dictum sit altum videtur