ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to get the name of the current Printer?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Apr 12 2021 : 10:47:55
I would like to show the Name of the current Printer (i.e. the name of the printer where the Printer dialog will print to, that could be customized in the Print dialog):

ImageEnView1.IO.DoPrintPreviewDialog(iedtDialog, '', False, 'Print (' + IECurrentPrinter.Name + ')');


But there is no IECurrentPrinter object or IECurrentPrinter.Name function.

Even the TIOPrintPreviewParams seems to not provide the name of the current Printer.

So how can I get the name of the current Printer set by the user in the Print Preview dialog?
3   L A T E S T    R E P L I E S    (Newest First)
PeterPanino Posted - Apr 13 2021 : 02:06:18
That's very nice, thank you!
xequte Posted - Apr 12 2021 : 19:26:14
Hi

To get the "active" printer you can use:


    if Printer.Printers.Count > 0 then
      Result := Printer.Printers[ Printer.PrinterIndex ];


I will make ImageEn display the active printer in the printer title bar for the next release.

Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - Apr 12 2021 : 12:00:44
With this code, I get the default printer in Windows:

var DefaultPrinter: array[0..79] of Char;
Winapi.Windows.GetProfileString('windows', 'device', '', DefaultPrinter, SizeOf(DefaultPrinter) - 1);
// Result: "HP Color LaserJet MFP M477fdn,winspool,Ne09:"


But as soon as the user changes the printer setting in the IE Print Preview dialog, that is not the printer where IE will print to.

So how can I get the name of the printer set by the user in the IE Print Preview dialog?