#1 2012-10-26 15:07:14

amnon
Member
Registered: 2012-10-26
Posts: 10

Metafile is invereted party

Hi,

I just found this site.  G R E A T E

I tried it out and have only one problem

I work in Hebrew.

When rendering a metafile the wording appears inverted.
ABCD in the MetaFile appears as DCBA in the PDF

The code
procedure TForm1.AmnonClick(Sender: TObject);
var
  _MetaFile:tMetaFile;
  i:integer;
begin
  _MetaFile:= tMetaFile.create;
  with TPdfDocumentGDI.Create do begin
    try
      Canvas.RightToLeftText:= true;
      ScreenLogPixels:= 300;
      for n:= 1 to 1 do begin
        _MetaFile.LoadFromFile(format('f:\EMF%d.emf',[n]));
        with AddPage do begin
          Canvas.RenderMetaFile(_MetaFile);
        end;
        SaveToFile('f:\Syntest.pdf');
      end;
    finally
      free;
    end;
  end;
end;

Please advice how I can attach files. I'd like to attach the EMf+PDF files

thanks

Offline

#2 2012-10-26 16:13:34

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,237
Website

Re: Metafile is invereted party

Did you enable Uniscribe?

Offline

#3 2012-10-27 06:19:05

amnon
Member
Registered: 2012-10-26
Posts: 10

Re: Metafile is invereted party

Thanks for answering so fast.


I enabled UniScribe.

see in my code

         Canvas.RightToLeftText:= true;

could not compile otherwise

Offline

#4 2012-10-27 06:38:16

amnon
Member
Registered: 2012-10-26
Posts: 10

Re: Metafile is invereted party

Hi again,

I debuged then component

After changing line 7798 in SynPDF the problem was solved

    Canvas.RightToLeftText := true;// R.emrtext.fOptions and ETO_RTLREADING<>0;


Thanks VERY much

Offline

#5 2012-10-28 21:21:00

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,237
Website

Re: Metafile is invereted party

My concern about this modification is that it won't work with left to right languages any more!

Why is ETO_RTLREADING not set in your metafile?

Offline

#6 2012-11-08 11:30:27

amnon
Member
Registered: 2012-10-26
Posts: 10

Re: Metafile is invereted party

I'm sorry for delay. I was too busy.


I have no idea what's the problem. and I was under time pressure to get results.

When working with left to write language the conditionals will take care of the user. The code is not generated at all.


Apropos, did anyone prepare a dll so the functionality will be usable in delphi 5 or any other language?

Offline

Board footer

Powered by FluxBB