Metafiles Problem

General TRichView support forum. Please post your questions here
Post Reply
MichaelV
Posts: 11
Joined: Mon Aug 30, 2010 6:19 am

Metafiles Problem

Post by MichaelV »

Hallo,

i have problems with metafiles here (emf).
I made a dokument with an embedded image (emf).
(because of much better printing)

TRichview shows the dokument fine, but when i save it to rtf,
word displays only a little one.
If i embed a bitmap (same source) it works.

Is this a bug or is there a trick?

Michael


[/url]
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Please send me RVF document with this metafile to email.
MichaelV
Posts: 11
Joined: Mon Aug 30, 2010 6:19 am

Post by MichaelV »

sended!
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I am afraid the only way to fix it is to modify your metafile. Its size is too huge.

Explanation.

When you load it in TMetafile, it has size 9999x5324 pixels. TRichView always uses this size (Graphic.Width and Graphic.Height properties) as 100% size of a picture. In the document, this picture is scaled to 600x319 pixels (i.e. 6% of its original size).

MS Word calculates picture size differently: it takes picture resolution to the account. I.e., by default, it uses not 9999x5324 as the original picture size, but (9999*picture resolution ratio)x(5324*picture resolution ratio). To prevent different calculations, TRichView uses special keywords to define the original picture size: picwgoal and pichgoal. They contain values in twips: \picwgoal149985\pichgoal79860 for your picture.
So TRichView define the original picture size and specify that the picture is scaled to 6%.

Normally, it works. But not for your metafile. It is because the numbers are too large and simply ignored by MS Word.

So the only solution is to make this metafile smaller.
MichaelV
Posts: 11
Joined: Mon Aug 30, 2010 6:19 am

Post by MichaelV »

ok, thank you,

it is no problem, the metafiles are generated by my program, i can easy change them. i insert metafiles, because of little size an much petter printing quality (this are generated drawings) The problem is, there can be small numbers from the dimensions.

please explain, how is the maximal pixel size in each direction, that you can handle?

Michael
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I believe you need to decrease metafile size at least by 10.
I am not sure which maximal size of picwgoal and pichgoal is understood by MS Word.
MichaelV
Posts: 11
Joined: Mon Aug 30, 2010 6:19 am

Post by MichaelV »

it works,
i have now 2000 units in each direction, and the wmf is good printable yet.
the export to rtf is ok :D
Post Reply