You are not logged in.
After run this code
procedure TForm1.Button2Click(Sender: TObject);
var i,j: Integer;
begin
with TPdfDocumentGDI.Create do
try
for j := 0 to 2 do
begin
AddPage;
VCLCanvas.Font.Assign(Label1.Font); // Try any font like Arial,Tahoma ....
VCLCanvas.Font.Size:=VCLCanvas.Font.Size+j*2;
UseUniScribe := true;
VCLCanvas.TextOut(100,500, 'بسم الله الرحمن الرحيم'); //This is Arabic Text Font
end;
UseUniScribe := true;
SaveToFile('testunicode_GDI.pdf');
ShellExecute(Handle,nil,'testunicode_GDI.pdf',nil,nil,SW_SHOWNORMAL);
finally
Free;
end;
end;
First page show arabic font fine
but all other pages has un-readable font
I think the problem com from
Line =8228
EnumEnhMetaFile(fDoc.FDC,MF.Handle,@EnumEMFFunc,E,R);
but
Other way can work perfect
like this source
procedure TForm1.Button3Click(Sender: TObject);
var i,j: Integer;
begin
with TPdfDocument.Create do
try
for j := 0 to 2 do
begin
AddPage;
UseUniScribe := true;
Canvas.SetFont('Microsoft sans serif',12,[fsItalic,fsBold]); // Try any font like Arial,Tahoma ....
Canvas.BeginText;
Canvas.MoveTextPoint(100,500);
Canvas.ShowText('بسم الله الرحمن الرحيم', True); //This is Arabic Text
Canvas.EndText;
end;
SaveToFile('testunicode.pdf');
ShellExecute(Handle,nil,'testunicode.pdf',nil,nil,SW_SHOWNORMAL);
finally
Free;
end;
end;
thanks
Offline
Did you retrieve the latest unstable version from http://synopse.info/fossil/wiki?name=Get+the+source ?
Which version of Delphi are you using?
An Unicode one should be better, here...
I suspect you should better set UseFontFallBack := true if the font does not include arabic glyphs.
Offline
Thank you very much for your fast response
My test is in Delphi XE3
Unit Name "SynPdf.Pas" version 1.18
and i already try
set UseFontFallBack := true
but nothing happening
Please remember my problem is only in next pages not in first one.
I do not have any problems in first Page.
Pdf File show in first page
shape 1 :
بسم الله الرحمن الرحيم
and that is good
and showing something Like this (I copy this from PDF file)
in other pages
shape 2 :
š∏&Ò´Ê=Ž¨&Ò´Ê=∂´´Ê=š*!
and that is bad and no one can read this
this is not a language
I think when calling
FCanvas.RenderMetaFile
it has different source structure for processing next pages than first page
only in case "UseUniScribe := true"
Did you retrieve the latest unstable version from http://synopse.info/fossil/wiki?name=Get+the+source ?
My answer is No
Offline
AFAIK UseUniscribe is global, so it should not make any difference with the page...
Please try with the latest version from our source code repository.
Some fixes are included, since the one you are using.
Offline
Many Thanks!! for your fast response.
Please be patient
This not "AFAIK" !!
of course I get latest version from your source code repository
please run my example
then see what i am tooking about
this is real and very real
I like your PDF tools and I see its very smart tools
but this problem stop me .
Example :
procedure TForm1.Button2Click(Sender: TObject);
var i,j: Integer;
begin
with TPdfDocumentGDI.Create do
try
for j := 0 to 2 do
begin
AddPage;
VCLCanvas.Font.Assign(Label1.Font); // Try any font like Arial,Tahoma ....
VCLCanvas.Font.Size:=VCLCanvas.Font.Size+j*2;
UseUniScribe := true;
VCLCanvas.TextOut(100,500, 'بسم الله الرحمن الرحيم'); //This is Arabic Text Font
end;
UseUniScribe := true;
SaveToFile('testunicode_GDI.pdf');
ShellExecute(Handle,nil,'testunicode_GDI.pdf',nil,nil,SW_SHOWNORMAL);
finally
Free;
end;
end;
I know UseUniscribe is global
but the problem come from
TPdfDocumentGDI technique
I already test many copies and with same Problem
Offline
Thanks to your code, I was able to reproduce the problem.
There was a unexpected GDI font object unselection during printing.
The following commit seems to fix this issue:
http://synopse.info/fossil/info/07289c1fcd
Thanks for the feedback!
Offline
Many Thanks!! .
It work perfect with All Right to left language now
Thanks again
Offline