#1 Re: PDF Engine » Problem with Hebrew strings » 2012-11-28 08:26:18

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 "

#2 Re: PDF Engine » Problem with Hebrew strings » 2012-11-27 11:03:50

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

#4 PDF Engine » Problem with Hebrew strings » 2012-11-26 14:32:13

amnon
Replies: 7

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

#6 PDF Engine » problem with Landscape » 2012-11-11 13:00:13

amnon
Replies: 2

Hi,

I try to print metafiles to PDF using the following code

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
        with AddPage do begin
          aMeta:= TMetaFile(Pages);
          if PagePrinter.Orientation=poLandscape then begin
//            Orientation:= poLandscape;
//            DefaultPaperSize:= PSA5;
            _Pdf.DefaultPageWidth := MulDiv(aMeta.Width,72,_Pdf.ScreenLogPixels);
            _Pdf.DefaultPageHeight := MulDiv(aMeta.Height,72,_Pdf.ScreenLogPixels);
          end;
//          _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
      with TSaveDialog.Create(NIL) do begin
        DefaultExt:= 'PDF';
        Title:= 'PDF שמור קובץ';
        if Execute then begin
          FN:= FileName;
          SaveToFile(FileName);
          WinExecAndWait(pchar(FN),'','',SW_SHOWNORMAL,{_Wait=}false);
        end;
      end;
    finally
      _PDF.free;
    end;
  end;

My problem is that the 1st page is size A4 and the data is cut.

The next 100 pages are ok

thanks

Amnon

#7 Re: PDF Engine » Metafile is invereted party » 2012-11-08 11:30:27

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?

#8 Re: PDF Engine » Metafile is invereted party » 2012-10-27 06:38:16

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

#9 Re: PDF Engine » Metafile is invereted party » 2012-10-27 06:19:05

Thanks for answering so fast.


I enabled UniScribe.

see in my code

         Canvas.RightToLeftText:= true;

could not compile otherwise

#10 PDF Engine » Metafile is invereted party » 2012-10-26 15:07:14

amnon
Replies: 5

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

Board footer

Powered by FluxBB