Hi
Couldn't find either in the manual nor the forums the indication of the units using to print:
Font Size
Text and Image Positioning
Image Size
Can some one tell me which are the units used for those three items?
ThankYou
Printing Units
Re: Printing Units
The sad reality is that PB does not have printer support. You really have to be familiar with the API to do it properly. This will get you started if you use Windows:
http://www.purebasic.fr/english/viewtop ... 27&t=43348
http://www.purebasic.fr/english/viewtop ... 27&t=43348
Re: Printing Units
Did not see much help in the post. But... Where Can I get the Printerb Lib mentioned? Do you know?
Thanks
Thanks
Re: Printing Units
http://www.purebasicpower.de/ClueLess wrote:Did not see much help in the post. But... Where Can I get the Printerb Lib mentioned? Do you know?
Thanks
- It was too lonely at the top.
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
-
BorisTheOld
- Enthusiast

- Posts: 542
- Joined: Tue Apr 24, 2012 5:08 pm
- Location: Ontario, Canada
Re: Printing Units
That's not entirely true.Tenaja wrote:The sad reality is that PB does not have printer support.
Although not perfect, PB's printer support, in conjunction with the 2D library, is very versatile.
The only thing missing is a good interface with printer hardware. But this is easy to overcome without having to use OS API features.
@ClueLess
Pixels are the unit of choice.
Use the features of the 2D library to calculate text sizes and positions. But be aware of the dot pitch of the printers you are using. You will need to factor the dot pitch into the size and position calculations. This means that you will usually need a larger font size for printing compared to displaying text on a screen.
Run a few tests of different font sizes to see which fonts best suit your application.
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
~ Spike Milligan
-
Lothar Schirm
- User

- Posts: 54
- Joined: Mon Nov 26, 2012 4:57 pm
Re: Printing Units
You can find an example how to print text or tables here:
http://forums.purebasic.com/german/view ... 352743646b
The example is written in pure PureBasic without WinAPI and should run on printers with any resolution. "PrintText(text)" prints a line of text and goes automatically to the next line and also to the next page, if the current page is full. If you use a font with fixed width (e.g. Courier New), you can easily print tables using RSet() or LSet() for substrings within the text line.
http://forums.purebasic.com/german/view ... 352743646b
The example is written in pure PureBasic without WinAPI and should run on printers with any resolution. "PrintText(text)" prints a line of text and goes automatically to the next line and also to the next page, if the current page is full. If you use a font with fixed width (e.g. Courier New), you can easily print tables using RSet() or LSet() for substrings within the text line.
Re: Printing Units
Thanks Lothar
Thanks for the procedure, it seems very handy, I will check it out.
Thanks for the procedure, it seems very handy, I will check it out.
- It was too lonely at the top.
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
