WPCubed Product Support

insert textboxs overlays

Hi,
I m trying to insert a list of TextBox, that contain an image and some text, on a document.

And I ve got some bugs :
1- All the textboxs overlays
2- Can not change the textbox background color
3- Can not fix the image size

My code

I               : Integer;
    w, h            : Integer;
    RTFDataBlock    : TWPRTFDataBlock;
    txtobj          : TWPTextObj;
    wpobj           : TWPObject;
    Image           : TWPObject;

    begin
    for I := 0 to 7 do
    begin
    WPRichText1.ActiveParagraph 	:= WPRichText1.BodyText.AppendNewPar();
    txtobj              := WPRichText1.TextObjects.InsertTextBox(w,h,RTFDataBlock);
    WPRichText1.ActiveParagraph.Append(txtobj);
    txtobj.PositionMode := wpotPar;
    txtobj.Wrap         := wpwrRight;  
    txtobj.Mode         := [wpobjRelativeToParagraph];

    RTFDataBlock.RtfText.AsString               := '';
    RTFDataBlock.RTFProps.AttrHelper.Clear;
    RTFDataBlock.RTFProps.AttrHelper.SetBGColor(clGreen); // have no effect
    RTFDataBlock.RtfText.AsString               :=  'First name - Last name \n Description';

    WPRichText1.ActiveText := RTFDataBlock;
    Image := WPRichText1.InsertGraphic('someimage.jpg');
    Image.HeightTW     = 50; // have no effect

    //Add some text around the textbox
    WPRichText1.ActiveParagraph 	:= WPRichText1.BodyText.AppendNewPar();
    WPRichText1.ActiveParagraph.Append("\n");
    WPRichText1.ActiveParagraph.Append("1er ligne");
    WPRichText1.ActiveParagraph.Append("\n");
    WPRichText1.ActiveParagraph.Append("2e ligne");
    WPRichText1.ActiveParagraph.Append("\n");       
    end;

    end;

Any ideas on what could be wrong?

#1 ♥ 0
7.3k Views 2 users read 2 min
support

You cannot select a background color for a textbox.

Inside textboxes only images are allowed which behave like characters. ( = not connected to page / paragraph)

#2 ♥ 0

So do you think it s possible to automatically generate a document like this ??

.

#3 ♥ 0
support

With Version 6 I don't believe. With V7 it should be possible - there is an event to paint into the background of the box. You may mail to support to get a sample.

Sorry - I had to remove your image though. Cannot allow images on this forum.

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