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
 ImageEnView1.DoPrintPreviewDialog

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
John Posted - Feb 19 2016 : 22:27:25
Hello

6.2.1

ImageEnView1.io.DoPrintPreviewDialog(iedtDialog);

The line of code above no longer shows a preview of the image, see below.








Suggestions?

John
3   L A T E S T    R E P L I E S    (Newest First)
John Posted - Feb 21 2016 : 05:53:01
William

I appreciate your reply with regard to the caption property.

Because I would not have knowledge of the end user's printer list or what printer they wish to use, I have changed the original code to the following.

procedure TformViewPhotographs.SpeedButtonPrintSingleClick(Sender: TObject);
var
  iPrinterIndex: Integer;
  tempPrinterName: string;
begin
  iPrinterIndex := -1;      // The assumption is that the default printer.PrinterIndex = -1;
  Printer.PrinterIndex := iPrinterIndex;
  tempPrinterName := Printer.Printers.Strings[Printer.PrinterIndex];
 
 ImageEnView1.io.DoPrintPreviewDialog(iedtDialog, 'Patient - ' + DataPatients.adsTablePatients.FieldByName('FirstName').AsString
 + ' ' + DataPatients.adsTablePatients.FieldByName('LastName').AsWideString,                                                False, 'Print Preview With Default Printer - ' + tempPrinterName);

end;


Suggestion 2:
If there was a mechanism to capture the current PrinterName in an OnCloseUp or OnChange event when the printer was changed in the print preview, then
a) the print preview caption could be updated and
b) the selected printer could be assigned to a global variable and reassigned if the print preview was closed and then reopened.

TIA

John
w2m Posted - Feb 20 2016 : 10:18:22
You can display the printer yourself in the dialog:

function GetHPPrinterIndex: Integer;
var
  i: Integer;
begin
  for i := 0 to Printer.Printers.Count - 1 do
    if AnsiContainsText(Printer.Printers[i], 'HP') then
    begin
      exit(i);
    end;
  Result := -1;
end;

procedure TForm1.Print1Click(Sender: TObject);
var
  iPrinterIndex: Integer;
  iPrinterName: string;
begin
  iPrinterIndex := GetHPPrinterIndex;
  Printer.PrinterIndex := iPrinterIndex;
  iPrinterName := Printer.Printers.Strings[Printer.PrinterIndex];
  ImageEnView1.IO.DoPrintPreviewDialog(iedtDialog, 'Image', False, 'Print Preview- ' + iPrinterName);
end;


Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development

John Posted - Feb 20 2016 : 09:57:49
Issue resolved, Sorry for the confusion.

The issue is that when the print preview initially displays, the preview is based upon the default printer. In the case of this example, this was a Dymo label printer. Once the appropriate printer was selected the preview displayed correctly.

Suggestion - What about appending the selected printer to the word "Preview" in the caption of the group box that actually displays the preview image?

TIA

John