#1 2012-11-26 14:32:13

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

Problem with Hebrew strings

When converting to PDF I have the following problem

a String containing then character " is reversed.


I.E       x"y   is printed as  y"x

I tried to debug the code but it's too complicated. Can you point me to the right routine?


thanks


Amnon

Offline

#2 2012-11-26 15:51:42

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

Re: Problem with Hebrew strings

Did you enable Uniscribe rendering?

Offline

#3 2012-11-27 04:39:03

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

Re: Problem with Hebrew strings

yes.

I use version 1.18

Offline

#4 2012-11-27 07:27:26

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

Re: Problem with Hebrew strings

Enabling Uniscribe not only by setting the USE_UNISCRIBE conditional, but by explicitly set UseUniscribe := true property of TPdfDocument.
Ensure you set this property.

If it does not work, try to force Canvas.RightToLeftText := TRUE line 8893 of SynPDF.
But from my understanding, ETO_RTLREADING should be set in R.emrtext.fOptions for hebrew.

Offline

#5 2012-11-27 11:03:50

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

Re: Problem with Hebrew strings

Thanks for your fast answer

I already did "UseUniscribe := true"

I corrected line # 8112  to     Canvas.RightToLeftText := true;// av R.emrtext.fOptions and ETO_RTLREADING<>0;

I have only 8400 lines in synPDF is there another version?


The problem I raises was solved but a new one appeared

Error in strings mixing Hebrea & digits
==============================
The string  "1 xxxx" appears as "xxxx1"  earlier it was ok

"6111  5 yyyy 1 xx" appears as "yyyy1  xx6111  5" 

it was wrong earlier too i just ignored it.

The  xxxx & yyyy are various Hebrew characters

Error strings mixing Latin & Hebrew

"AXmYon"  appears as "nonYmXA"

It will help me if you point me to the routine doing the inverting.

thanks again

Amnon

Offline

#6 2012-11-27 15:25:10

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

Re: Problem with Hebrew strings

Do you use metafile rendering to produce the pdf?

Offline

#7 2012-11-28 08:26:18

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

Re: Problem with Hebrew strings

attached is my full code

procedure TPreviewPrint.PDFClick(Sender: TObject);
var
  i:integer;
  _PDF:TPdfDocumentGDI;
  FN:ansiString;
  aMeta:TMetaFile;
begin
  _PDF:= TPdfDocumentGDI.Create;
  with _PDF do begin
    UseUniscribe:= true;
    try
      _PDF.Canvas.RightToLeftText:= true;
      ScreenLogPixels:= 600;
      with PagePrinter do for i:= 1 to PagesList.count do begin
        aMeta:= TMetaFile(Pages);
//ConvertWMF2BMP(aMeta,'c:\Temp\a.bmp');
        if PagePrinter.Orientation=poLandscape then begin
           _Pdf.DefaultPageWidth := MulDiv(aMeta.Width,72,_Pdf.ScreenLogPixels);
          _Pdf.DefaultPageHeight := MulDiv(aMeta.Height,72,_Pdf.ScreenLogPixels);
        end;

        with AddPage do begin
//          _pdf.VCLCanvas.Draw(0,0,aMeta);   // from "http://forum.quickreport.co.uk/default. … osts&t=589"
          _PDF.Canvas.RenderMetaFile(aMeta); // from "http://synopse.info/forum/viewtopic.php?id=138"
        end;
      end; // with PagePrinter
    without this lin I get an error message " was found without a matching "

Offline

#8 2015-04-18 08:11:49

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

Re: Problem with Hebrew strings

Please try the latest SynPDF commit proposed by "nosa".
See http://synopse.info/forum/viewtopic.php?id=2515

It includes a lot of improvements for Uniscribe, especially for Right To Left languages.

Offline

Board footer

Powered by FluxBB