Printing to my Printer
#16
Give this a try:

Code: (Select All)
'How to properly _PRINTIMAGE a screen of text
'by Steve!

$Color:32
Const scale = 80


Screen _NewImage(7.5 * scale, 10 * scale, 32) 'standard printer paper is 8.5 x 11 inches, with .5 margins.
'                                                This gives us a 7.5 x 10 inch print area.
'                                                Scale here is used so we can set this to a proper size for our PC display
'                                                In this case, I'm going with a 600 x 800 screen size.
'                                               Notice in most cases, this is a simple 3:4 width:height ratio!

Cls , White '                                   Set the screen to being a white color, so that you won't print your page in black.
Color Black '                                   Set the text to Black so that it'll show up on the screen as you desire.
_PrintMode _KeepBackground '                    And either set the color with a transparent background, a white background,
'                                                or use printmode so you're not printing Black on the default Black background.


Print "This screen is"; 7.5 * scale; "pixels wide, and"; 10 * scale; "pixels high."
Print
Print "Also notice that I've colored the background white, and the text black."
Print
Print "And this is honestly all I need to do to set up a page for proper printing with _PRINTIMAGE."
Print
Print "Press <ANY KEY> to see for yourself!"
Sleep

_PrintImage 0 'the 0 here says to print the active/visual screen image.


For me, this will open a text dialog and print me a PDF file as I have "Microsoft Print to PDF" set as my default printer.  If your physical printer is set as the default output, then you can use this to print directly to it instead.  If you need to choose between printer outputs, then you have a lot more code to write to interface with the printer management interface used by your OS, but if you just want to print to your default printer, this is all you really need to do for it.
Reply


Messages In This Thread
Printing to my Printer - by Dimster - 07-12-2022, 03:11 PM
RE: Printing to my Printer - by Pete - 07-12-2022, 05:30 PM
RE: Printing to my Printer - by SierraKen - 07-12-2022, 05:49 PM
RE: Printing to my Printer - by SierraKen - 07-12-2022, 05:50 PM
RE: Printing to my Printer - by bplus - 07-12-2022, 05:53 PM
RE: Printing to my Printer - by Dimster - 07-12-2022, 06:24 PM
RE: Printing to my Printer - by Kernelpanic - 07-12-2022, 09:02 PM
RE: Printing to my Printer - by SierraKen - 07-13-2022, 01:09 AM
RE: Printing to my Printer - by bplus - 07-12-2022, 11:16 PM
RE: Printing to my Printer - by George McGinn - 07-13-2022, 01:25 AM
RE: Printing to my Printer - by Dimster - 07-14-2022, 01:13 PM
RE: Printing to my Printer - by OldMoses - 07-14-2022, 02:39 PM
RE: Printing to my Printer - by Dimster - 07-14-2022, 03:25 PM
RE: Printing to my Printer - by Kernelpanic - 07-14-2022, 03:55 PM
RE: Printing to my Printer - by bplus - 07-14-2022, 04:24 PM
RE: Printing to my Printer - by SMcNeill - 07-14-2022, 05:47 PM
RE: Printing to my Printer - by Dimster - 07-14-2022, 06:33 PM
RE: Printing to my Printer - by SMcNeill - 07-14-2022, 06:54 PM



Users browsing this thread: 14 Guest(s)