do not change the default printer

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
rellik
Posts: 18
Joined: Mon Oct 05, 2015 9:17 am

do not change the default printer

Post by rellik »

I linked TSrvPrint with TSRichViewEdit.

Than I call TPrintDialog, CHANGE DEFAULT PRINTER and do

SRVPrint1.Print('', PrintDialog1.Copies, PrintDialog1.Collate);

But prints ONLY occurs on the default printer.

So, I can't change the default printer by standart printer dialog.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, I cannot reproduce this problem.
In my test, SRVPrint prints on the chosen printer.

I tested in the demo Demos\SRVPrint\PM_Auto\

Test 1

I added a new button in this demo, and assigned in its OnClick:

Code: Select all

SRVPrint1.Print('test', 1, False);
This demo allows choosing a printed from a combo box. When user chooses a printer, the demo assigns Printer.PrinterIndex.
Result: the demo prints on the printer chosen in the combo box, as expected.

Test 2
I placed TPrintDialog on this form, and modified the code in OnClick:

Code: Select all

  if PrintDialog1.Execute then begin
    // we should also assign cmbPrinter.ItemIndex := Printer.PrinterIndex;
    // but I did not do it to make sure that the printer is changed only by TPrintDialog
    UpdateControlsForPrinter;
    SRVPrint1.Print('test', 1, False);
  end;
Result: the demo prints on the printer chosen in the dialog, as expected.
rellik
Posts: 18
Joined: Mon Oct 05, 2015 9:17 am

Post by rellik »

Sergey Tkachenko wrote:
Sorry, Sergey! I'ts my fault, I used TdxPrintDialog, not standart :oops:
Post Reply