Get Selected Printer

Ok, thanks. After I restarted my computer it worked (I have gremlins).

This brings up another issue (remembering this is Win7)…

The PageSetupDialog assumes the default printer (when no SetupString has yet been established). Consequently, the listed paper size options are not appropriate. For example, when trying to do this process for a receipt printer, ideally it would list an 80mm wide roll as a type of paper. But, when the default printer is a typical sheet-fed printer, it lists essentially full pages and envelopes instead.

Is there any way around this?

No. You’d have to go through the process twice. The second time round, it would show the correct options for the paper.

Soooo… The antithesis of “user-friendly”.

Man… Every time I give Xojo/RealStudio a shot, I run into these ridiculous limitations - and for things that should be so simple. Seriously, how am I going to justifiably explain a crap procedure like that in the program’s Help system?

Sorry - Just ranting. Thanks for your assistance Tim.

1 Like

Windows 7 Network Printers

I too have the same problem. I need to know what printer the user has selected after using the OpenPrinterDialog function like so:

[code]ps = new PrinterSetup
if ps.PageSetupDialog then
pss = ps.SetupString
else
return
end if

g = OpenPrinterDialog(ps)

if g <> nil then

end if[/code]

The printer selected may not necessarily be the default printer. After returning the Graphics object, there is no property I can read which tells me the name of the printer being used. The name of the printer is embedded in the PrintSetupString, but not easily readable using any standard method.

So simple yet so difficult.

Cheers
Grant

I found the solution…
VB.Net

1 Like

[quote=51223:@Mark Lewis]I found the solution…
VB.Net[/quote]

I presume you’re being sarcastic Mark. Much more effective if your link worked.

I didn’t put the link there. Just the text. The link must have been generated by the message board, as it’s apparently an actual address (not my intent).

Totally fed up with Xojo. It just can’t handle real world, serious applications. Packed it in and went back to VB .Net where I don’t have to go scrounging for workarounds, where there’s a gazillion 3rd party modern controls to handle anything you could possibly want, and where everything just works.

[quote=51231:@Mark Lewis]I didn’t put the link there. Just the text. The link must have been generated by the message board, as it’s apparently an actual address (not my intent).

Totally fed up with Xojo. It just can’t handle real world, serious applications. Packed it in and went back to VB .Net where I don’t have to go scrounging for workarounds, where there’s a gazillion 3rd party modern controls to handle anything you could possibly want, and where everything just works.[/quote]

Mark I understand. At times it is frustrating. I too have had to do a few workarounds.

Hi,

the thread question (Get Selected Printer) is misleading:

You assume a Printer IS selected.

Here, I do not have a Printer selected at all, but I print to PDF (both WINDOWS and Macintosh) and I send it for paper printing.

What will you do in that case ?

I finally came up with a windows solution. This small app project keeps track of/sets the default printer.

An easy way to print to a specific printer without messing with the settings is to get and store the default printer, then change the default printer, and do your printing. After printing is finished change back to the previous default printer.