WPCubed Product Support

Random failure to print a logo

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.

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;
#1 ♥ 0
6.4k Views 2 users read 2 min
support

Hi,

if the logo in all the letters it can be a resource issue. You can also use the TextObjectPaint event to draw the logo there.

#2 ♥ 0

Anything we can do about resources? Are you talking about RAM? It seems that the problem has happened on XP machines, and once on a Vista box.

#3 ♥ 0
support

Resources are not just ram, that are handles for images, brushes etc.

I really don't know if a resource problem is the reason for the logo to not become printed.

In the TextObjectPaint you can draw the logo to the canvas - it is worth a try.

Julian

#4 ♥ 0
This category is archived. No new posts are possible.