T O P I C R E V I E W |
fourwhey |
Posted - Jan 24 2014 : 13:08:43 I can print images individually. However, if I call TImageEnMView.MIO.PrintImage(IEM_SELECTED_IMAGES, ...) only the last selected image prints when Printer.EndDoc is called.
Any idea how I might work around this? Here's the code I'm using to print.
procedure TForm1.btnPrintSelectedClick(Sender: TObject);
begin
if iemvDocs.MultiSelectedImagesCount > 0 then
begin
Printer.BeginDoc;
iemvDocs.MIO.PrintImage(IEM_SELECTED_IMAGES, Printer.Canvas, 0, 0, 0, 0, ievpCENTER, iehpCENTER, iesFITTOPAGE, 0, 0, 1);
Printer.EndDoc;
end
else
ShowMessage('There are no selected items.');
end; |
3 L A T E S T R E P L I E S (Newest First) |
fourwhey |
Posted - Jan 31 2014 : 14:44:26 Great! Thank you for following up on this.
I implemented your suggestion and see why it's a good idea.
In case anyone else see's this, Printer.NewPage checks to see if the printer is available prior to starting and does some cleanup to prep for a new print job -- among other things.
Thanks. |
xequte |
Posted - Jan 28 2014 : 19:36:15 Hi
This is fixed for the next release.
A better way to handle your code would be:
if iemvDocs.MultiSelectedImagesCount > 0 then
begin
bFirstImage := True;
Printer.BeginDoc;
for I := 0 to iemvDocs.ImageCount -1 do
if iemvDocs.IsSelected(I) then
begin
if bFirstImage then
Printer.NewPage;
bFirstImage := False;
iemvDocs.MIO.PrintImage(I, Printer.Canvas, 0, 0, 0, 0, ievpCENTER, iehpCENTER, iesFITTOPAGE, 0, 0, 1);
end;
Printer.EndDoc;
end...
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
fourwhey |
Posted - Jan 24 2014 : 13:48:10 I ended up implementing the check for selected items myself. There does still seem to be an issue with calling PrintImage using the constants to PrintSelected or PrintAll. From what I've seen, it only prints the last selected image - or basically the last one to be handled by _PrintImage(I) prior to Printer.EndDoc being called.
Snippet...
if iemvDocs.MultiSelectedImagesCount > 0 then
begin
for I := 0 to iemvDocs.ImageCount -1 do
if iemvDocs.IsSelected(I) then
begin
Printer.BeginDoc;
iemvDocs.MIO.PrintImage(I, Printer.Canvas, 0, 0, 0, 0, ievpCENTER, iehpCENTER, iesFITTOPAGE, 0, 0, 1);
Printer.EndDoc;
end;
end...
Perhaps Printer.BeginDoc and Printer.EndDoc need to be handled inside the loop for ImageEnMView.MIO.PrintImage when PrintSelected or PrintAll are requested?
This does work, but I'm not sure if it was left out for some reason that I'm unaware of.
|
|
|