Once in awhile we'll print a few hundred merged letters, and one of them will fail to print the logo (one logo is used per batch -- it is preloaded into a variable before the merge begins). We can re-print that one item and the logo is ok. We can re-print the whole batch and almost always all the logos are fine. This happens on different computers and printers.
This happens in Delphi 7 and also in Delphi XE (duplicate code in each environment).
Is there any known issue we can address? Sounds like a timing loop issue to me, but I have no idea where it might be, except that we seem to have eliminated delphi and the printer driver. Here's the code, which I'm sure looks familiar.
Code
procedure TMergeEngine.rtfTemplateMailMergeGetText(Sender: TObject;
const inspname: String; Contents: TWPMMInsertTextContents);
var
wpobj : TWPOImage;
begin
//vvv jhg 04/02/2013
if UpperCase(inspname)='LOGO' then begin
// A) - there is no image in this field
if Contents.CurrentObject=nil then
begin
wpobj := TWPOImage.Create(rtfTemplate);
if (rv.LenderLogo.Picture.Graphic<>nil) then begin
wpobj.Graphic := rv.Logo.Picture.Graphic;
wpobj.WidthTW := wpobj.ContentsWidth;
wpobj.HeightTW:= wpobj.ContentsHeight;
Contents.obj := wpobj;
end;
end
else
// B) There is an image, we replace the contents
begin
Contents.CurrentObject.Graphic := rv.Logo.Picture.Graphic;
end;
end
else
contents.StringValue := rv.propertyByName(inspname);
//^^^ jhg 04/02/2013
end;
Alles anzeigen