WMF font spacing problem

Hi there,

I have an app that generates slides containing scaled wmf documents, in a web farm of 6 servers,

2 of the servers are creating Slides with fonts that are incorrectly spaced !! (bottom ppt in attached image)

whilst the rest are correct (top ppt in the attached image),

FYI

I have been informed that the servers are all identical, any ideas ?

I'm using aspose slides 2.7.2.0

If I dump the wmf straight out of the app it looks ok on all servers,

Note :

height/width is calculated as Math.Round(((4.49) * .3942) * 576),0)

The actual wmf size is 46.57 cm x 46.57 cm

If I edit the WMF (righ click edit picture ( the text spacing corrects itself )

below is the code to add a wmf to the slide....

System.IO.MemoryStream ms = new System.IO.MemoryStream(PPUP.FILEDATA);

System.Drawing.Imaging.Metafile meta = new System.Drawing.Imaging.Metafile(ms);

Picture objPicture = new Picture(Tombpres, meta);

int objPictureID = Tombpres.Pictures.Add(objPicture);

PictureFrame objPictureFrame = objSlide.Shapes.AddPictureFrame(objPictureID, xpos, ypos, pictureWidth, pictureHeight);

It seems that fonts are not installed on other two servers , probably some of the fonts are missing there.

Hi there, The installed fonts are identical on all machines !

Any other ideas ?

Directory of c:\windows\Fonts

25/03/2003 13:00 46,544 ahronbd.ttf
25/03/2003 13:00 118,236 andlso.ttf
25/03/2003 13:00 102,312 ANGSA.TTF
25/03/2003 13:00 98,196 ANGSAB.TTF
25/03/2003 13:00 81,504 ANGSAI.TTF
25/03/2003 13:00 102,304 ANGSAU.TTF
25/03/2003 13:00 98,196 ANGSAUB.TTF
25/03/2003 13:00 81,572 ANGSAUI.TTF
25/03/2003 13:00 82,800 ANGSAUZ.TTF
25/03/2003 13:00 82,712 ANGSAZ.TTF
24/03/2005 18:55 367,112 arial.ttf
24/03/2005 18:55 352,224 arialbd.ttf
25/03/2003 13:00 226,748 arialbi.ttf
25/03/2003 13:00 207,808 ariali.ttf
25/03/2003 13:00 117,028 ariblk.ttf
25/03/2003 13:00 91,120 artrbdo.ttf
25/03/2003 13:00 89,776 artro.ttf
25/03/2003 13:00 86,892 BROWA.TTF
25/03/2003 13:00 72,792 BROWAB.TTF
25/03/2003 13:00 84,972 BROWAI.TTF
25/03/2003 13:00 86,884 BROWAU.TTF
25/03/2003 13:00 72,788 BROWAUB.TTF
25/03/2003 13:00 84,968 BROWAUI.TTF
25/03/2003 13:00 74,668 BROWAUZ.TTF
25/03/2003 13:00 74,672 BROWAZ.TTF
25/03/2003 13:00 127,596 comic.ttf
25/03/2003 13:00 111,476 comicbd.ttf
25/03/2003 13:00 102,596 CORDIA.TTF
25/03/2003 13:00 89,460 CORDIAB.TTF
25/03/2003 13:00 82,212 CORDIAI.TTF
25/03/2003 13:00 102,580 CORDIAU.TTF
25/03/2003 13:00 89,456 CORDIAUB.TTF
25/03/2003 13:00 82,208 CORDIAUI.TTF
25/03/2003 13:00 76,360 CORDIAUZ.TTF
25/03/2003 13:00 76,364 CORDIAZ.TTF
25/03/2003 13:00 303,296 cour.ttf
25/03/2003 13:00 312,920 courbd.ttf
25/03/2003 13:00 236,148 courbi.ttf
25/03/2003 13:00 245,032 couri.ttf
25/03/2003 13:00 53,976 david.ttf
25/03/2003 13:00 53,148 davidbd.ttf
25/03/2003 13:00 53,816 davidtr.ttf
25/03/2003 13:00 79,744 estre.ttf
25/03/2003 13:00 135,984 framd.ttf
25/03/2003 13:00 152,844 framdit.ttf
25/03/2003 13:00 61,408 frank.ttf
25/03/2003 13:00 214,936 gautami.ttf
25/03/2003 13:00 155,068 georgia.ttf
25/03/2003 13:00 141,032 georgiab.ttf
25/03/2003 13:00 157,388 georgiai.ttf
25/03/2003 13:00 159,736 georgiaz.ttf
25/03/2003 13:00 136,076 impact.ttf
25/03/2003 13:00 73,292 latha.ttf
25/03/2003 13:00 115,068 lucon.ttf
25/03/2003 13:00 54,432 lvnm.ttf
25/03/2003 13:00 52,296 lvnmbd.ttf
25/03/2003 13:00 323,980 l_10646.ttf
25/03/2003 13:00 143,864 mangal.ttf
25/03/2003 13:00 460,728 micross.ttf
25/03/2003 13:00 8,704 modern.fon
25/03/2003 13:00 49,556 mriam.ttf
25/03/2003 13:00 54,308 mriamc.ttf
25/03/2003 13:00 53,152 mriamfx.ttf
25/03/2003 13:00 48,908 mriamtr.ttf
25/03/2003 13:00 40,500 mvboli.ttf
25/03/2003 13:00 54,356 nrkis.ttf
25/03/2003 13:00 489,884 pala.ttf
25/03/2003 13:00 434,004 palab.ttf
25/03/2003 13:00 344,288 palabi.ttf
25/03/2003 13:00 430,800 palai.ttf
25/03/2003 13:00 57,348 raavi.ttf
25/03/2003 13:00 59,544 rod.ttf
25/03/2003 13:00 59,852 rodtr.ttf
25/03/2003 13:00 13,312 roman.fon
25/03/2003 13:00 12,288 script.fon
25/03/2003 13:00 234,280 shruti.ttf
25/03/2003 13:00 90,764 simpbdo.ttf
25/03/2003 13:00 90,624 simpfxo.ttf
25/03/2003 13:00 90,400 simpo.ttf
25/03/2003 13:00 221,676 sylfaen.ttf
25/03/2003 13:00 69,464 symbol.ttf
25/03/2003 13:00 379,856 tahoma.ttf
25/03/2003 13:00 352,868 tahomabd.ttf
24/03/2005 19:25 409,280 times.ttf
24/03/2005 19:25 398,372 timesbd.ttf
25/03/2003 13:00 239,692 timesbi.ttf
25/03/2003 13:00 248,368 timesi.ttf
25/03/2003 13:00 127,748 tradbdo.ttf
25/03/2003 13:00 127,848 trado.ttf
25/03/2003 13:00 134,108 trebuc.ttf
25/03/2003 13:00 123,096 trebucbd.ttf
25/03/2003 13:00 131,188 trebucbi.ttf
25/03/2003 13:00 139,288 trebucit.ttf
25/03/2003 13:00 148,624 tunga.ttf
25/03/2003 13:00 48,660 UPCDB.TTF
25/03/2003 13:00 50,848 UPCDBI.TTF
25/03/2003 13:00 52,104 UPCDI.TTF
25/03/2003 13:00 49,832 UPCDL.TTF
25/03/2003 13:00 53,688 UPCEB.TTF
25/03/2003 13:00 55,340 UPCEBI.TTF
25/03/2003 13:00 55,416 UPCEI.TTF
25/03/2003 13:00 53,308 UPCEL.TTF
25/03/2003 13:00 48,728 UPCFB.TTF
25/03/2003 13:00 51,040 UPCFBI.TTF
25/03/2003 13:00 51,276 UPCFI.TTF
25/03/2003 13:00 49,804 UPCFL.TTF
25/03/2003 13:00 53,996 UPCIB.TTF
25/03/2003 13:00 55,344 UPCIBI.TTF
25/03/2003 13:00 55,192 UPCII.TTF
25/03/2003 13:00 53,648 UPCIL.TTF
25/03/2003 13:00 54,404 UPCJB.TTF
25/03/2003 13:00 56,496 UPCJBI.TTF
25/03/2003 13:00 55,608 UPCJI.TTF
25/03/2003 13:00 53,600 UPCJL.TTF
25/03/2003 13:00 46,868 UPCKB.TTF
25/03/2003 13:00 49,992 UPCKBI.TTF
25/03/2003 13:00 49,088 UPCKI.TTF
25/03/2003 13:00 46,268 UPCKL.TTF
25/03/2003 13:00 39,460 UPCLB.TTF
25/03/2003 13:00 41,336 UPCLBI.TTF
25/03/2003 13:00 41,132 UPCLI.TTF
25/03/2003 13:00 39,200 UPCLL.TTF
25/03/2003 13:00 171,792 verdana.ttf
25/03/2003 13:00 137,616 verdanab.ttf
25/03/2003 13:00 155,076 verdanai.ttf
25/03/2003 13:00 154,800 verdanaz.ttf
25/03/2003 13:00 118,752 webdings.ttf
25/03/2003 13:00 81,000 wingding.ttf
25/03/2003 13:00 18,880 wst_czec.fon
25/03/2003 13:00 18,880 wst_engl.fon
25/03/2003 13:00 18,880 wst_fren.fon
25/03/2003 13:00 18,880 wst_germ.fon
25/03/2003 13:00 18,880 wst_ital.fon
25/03/2003 13:00 18,880 wst_span.fon
25/03/2003 13:00 18,880 wst_swed.fon
135 File(s) 16,132,568 bytes
0 Dir(s) 1,397,006,336 bytes free

Hello,

Please check, if it is a trust level problem.

Aspose.Slides must use System.Drawing.Imaging.Metafile class to open and render presentations with wmf/emf metafiles. By unknown reasons Microsoft’s .Net framework doesn’t allow this class to work with Medium trust level. It works in Full trust mode only. So it looks like currently Aspose.Slides can’t process presentations with metafiles in Medium trust.

Please provide your source presentation, in case, it is not resolved, so we could investigate it.

  • C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config - no reference to trust level
  • C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\machine.config - trust level is set to full ()
  • application web.config - no reference to trust level

  • Is there anything else ?

    Try the full trust level in your web.config file e.g

    Settings in web.config file takes precedence over the machine.config file.

    Sorry it did not work !

    I have set the trust level to full, however the wmf fonts spacing is still incorrect on some of the web farm servers.

    Any other ideas ?

    Hi there, Just chasing this problem, have you a solution yet ?

    I have requested the technical team lead to help you. He will help you as soon as possible. Thanks for your patience.

    Try to add metafile as stream instead of System.Drawing.Imaging.Metafile.

    System.IO.MemoryStream ms = new System.IO.MemoryStream(PPUP.FILEDATA);

    Picture objPicture = new Picture(Tombpres, ms);

    int objPictureID = Tombpres.Pictures.Add(objPicture);

    PictureFrame objPictureFrame = objSlide.Shapes.AddPictureFrame(objPictureID, xpos, ypos, pictureWidth, pictureHeight);


    There can be too many possible reasons so it would be great if you can provide metafile and both presentations with wrong and correct font spacing. May be servers have different .Net runtime version. May be some of them don't have GDI+.

    The suggested solution worked,

    Thanks for you all help on this.