Merge multiple images

  • i use this code inside OnMailMergeGet to insert each image:

    Code
    obj:=Wprtf.TextObjects.InsertCopy(TGraphic(lstJpg[nrImg]));
                  obj.PositionMode:=wpotChar;
                  obj.Unlink;
                  obj.Attach(contents.mergePar);
                  obj.PositionMode:=wpotChar;

    But i don't see the images…..

    Einmal editiert, zuletzt von Lepr8 (6. März 2019 um 07:36)

    • Offizieller Beitrag

    It's really like I wrote, you can simply add text and images like you would usually using code.

    Code
    procedure TForm.WPRichText1MailMergeGetText(Sender: TObject;
      const inspname: string; Contents: TWPMMInsertTextContents);
    begin
       (Sender as TWPCustomRtfEdit).TextObjects.InsertCopy(Image1.Picture.Graphic);
    end;

    You can insert another image, use InputString to insert some text...

    But if you do so, you need to leave Contents unchanged. Also do not use Contents.MergePar or anything else inside Contents.

  • I use WpTools v.5 and doesn't work.... this is a feature of new version ?

    Inside RTF file generated, i see :

    Code
    \pard\plain\sl-198\qj\plain\f1\fs18\par
    \page\plain\f2\fs22  {\*\wptools\wpomode0\wpoframe0{\bin98 
     TWPObject TPF0    TWPObject WidthTW Ã  HeightTW@'  WriteRTFModewobAutomaticObjTag   ??? }}\par
    \page\plain\f2\fs22  \par

    If not, can I add an empty second after the first page and insert my images?

    REgards