Metafile are created differently

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
Posts: 6
Joined: Tue May 13, 2014 4:11 pm

Metafile are created differently

Post by yagui »

I really need help with this issue. I'm generating the EMF files to create a PDF in different machines but I can see that the resulting EMF file are different.

I upload the resulting EMF files and the rvf original file. You can download from

Why the EMFs are different if they were created from the same rvf document with the same source code but in different PCs?

The source code that I'm using is:

Code: Select all

  SRichViewEdit1.RichViewEdit.LiveSpellingMode := rvlspManualStart;

  rve := SRichViewEdit1.ActiveEditor;
  rve.SetSelectionBounds(rve.CurItemNo, rve.OffsetInCurItem, rve.CurItemNo, rve.OffsetInCurItem);

  SRichViewEdit1.ViewProperty.ZoomPercent := 100;

  TempFile := GenerateTempFilename;
  WPPDFPrinter1.FileName := TempFile;
  WPPDFPrinter1.CompressStreamMethod := TWPCompressStreamMethod.wpCompressFlate;

  WPPDFPrinter1.FontMode := TWPPDFFontMode.wpEmbedSymbolTrueTypeFonts; //solamente incrusta los Fonts symbol como el codigo de barra
  WPPDFPrinter1.Info.Title := IntToStr(_idTexto);

  Impares := 1;

    for LI := 1 to SRichViewEdit1.PageCount do
         a := TMetafile.Create;
         a.Width :=  SRichViewEdit1.PageWidthPix;
         a.Height := SRichViewEdit1.PageHeightPix;

         SRichViewEdit1.DrawMetafile(LI, a ,SRichViewEdit1.PageProperty.PageNoVisible,true,false);

         a.SaveToFile('C:\Users\mandres\AppData\Roaming\SimpCivil\' + IntToStr(LI) + '.emf');

         Impares := Impares * -1;

         WPPDFPrinter1.DrawMetafile(0, 0, a.Handle);



I really appreciate your help in this issue.

Thanks and regards,

Sergey Tkachenko
Site Admin
Posts: 15238
Joined: Sat Aug 27, 2005 10:28 am

Post by Sergey Tkachenko »

Answered by email

Sergey Tkachenko
Site Admin
Posts: 15238
Joined: Sat Aug 27, 2005 10:28 am

Post by Sergey Tkachenko »

Summary of our conversation.

The problem happens when generating metafiles while accessing a computer via a remote desktop, with a changed desktop resolution.
Previously, a similar problem was reported for metafiles generated in a virtual machine, in a windowed mode.

This problem is not related to our components, it affects all TMetafile metafiles created on such computers. Horizontal and vertical dpi values are calculated incorrectly. A workaround - using remote desktops and virtual machines in a full screen mode.

Post Reply