WPCubed Product Support

Question about FAQ on mailmerge of images

I'm trying to understand this FAQ and not getting very far. Pardon my ignorance.

I have a jpg (a logo image) in a database that should print at the top of each merged document. In the example you refer to image1 and image2. What are these, and where do they live? Do you have a more complete example?

#1 ♥ 0
10.3k Views 3 users read 2 min
support

Image1 and Image2 is a TImage instance which resides on the current form.

You can also use

wpobj := TWPOImage.Create(TemplateEdit);
wpobj.LoadFromFile(somejpeg);
wpobj.WidthTW := wpobj.ContentsWidth;
wpobj.HeightTW:= wpobj.ContentsHeight;

#2 ♥ 0

Is it possible to support transparent graphics for merge fields?

I'd like to be able to have signatures stored as PNG's and want the signatures to not obscure the signature line.

Thanks,
John

#3 ♥ 0
support

Hi,

since transparency produces problems with some printers, I would rather put the image behind the text.

You can use the flag wpobjObjectUnderText on ObjModes of the TWPTextObject which holds the image.

Julian

#4 ♥ 0

Julian,

Excellent! This then allows you to use any opaque graphic.

Thanks,

John

#5 ♥ 0

I'm having problems with enumeration when trying to make the fieldcontents appear under the text;

procedure TRTFViewerForm.DBWPRichText1MailMergeGetText(Sender: TObject;
const inspname: string; Contents: TWPMMInsertTextContents);
begin

// valid? but won't compile
If Contents.CurrentTxtObject.IsBitMap then
Contents.CurrentTxtObject.Mode := wpobjObjectUnderText;

end;

I'm missing something simple.

Thanks,
John

#6 ♥ 0
support

Thats has to be done like this:

Contents.CurrentTxtObject.Mode := Contents.CurrentTxtObject.Mode + [wpobjObjectUnderText];

#7 ♥ 0

This works Julian. Thanks.

I am able to merge BMP's, but, not JPEGs. I get an "Invalid Graphic" error when merging using a JPEG.

I've followed the instructions for resizing, manually adjusting the BMP's that are merged, but, the size changes are not stored with the RTF. The BMP's come back to their native size.

I've not experimented with the size of the images as stored in the blobs, but, it seems I am missing something to allow me to save the adjusted size of the merged image fields with the RTF.

Thanks again,
John

#8 ♥ 0
support

Hi,

In all my tests the size was saved. Did you check out the written RTF code?

I would recommend to trace into wpobj.LoadFromFile(somejpeg); to see why it is not reading the JPEG. Its probably something simple, missing $DEFINE.

If tracing does not work, activate $WPDEBUG for the project and a do a buildall.

Julian

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