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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Setting printer index to TImageEnView.PdfViewer
 New Topic  Reply to Topic
Author  Topic Next Topic  

FabioDefferrari

Brazil
5 Posts

Posted - Dec 02 2026 :  07:45:24  Show Profile  Reply
Hi,

As long as I found out, TImageEnView.PdfViewer always prints to the default printer, right? Is there a way to manually set the printer TImageEnView.PdfViewer will use to print?

Best regards,

Fabio

xequte

39617 Posts

Posted - Dec 02 2026 :  18:34:34  Show Profile  Reply
Hi Fabio,

TImageEnView.PdfViewer.Print doesn't choose a printer itself. It prints to the global VCL Printer object in Vcl.Printers. That object starts on the Windows default printer, so unless your code changes it, the job goes there.

When you call Print( True ) and the user picks a printer in the print dialog, the dialog changes that same Printer object.

To print to a specific printer without showing the dialog, set Printer.PrinterIndex before calling Print:
uses
  Vcl.Printers;

var
  idx: Integer;
begin
  idx := Printer.Printers.IndexOf( 'HP LaserJet M404' );  // Name as listed in Windows
  if idx >= 0 then
    Printer.PrinterIndex := idx;
  ImageEnView1.PdfViewer.Print( False );
end;

Notes:
- To go back to the system default printer, set Printer.PrinterIndex := -1.
- This setting applies to your whole application, so later printing also uses that printer until you change it.
- Orientation, number of copies and similar settings also come from Printer, so you can set those the same way before printing.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
   Topic Next Topic  
 New Topic  Reply to Topic
Jump To: