You are not logged in.
Pages: 1
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 "
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
yes.
I use version 1.18
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
Thanks
Just a stupid bug
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
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?
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
Thanks for answering so fast.
I enabled UniScribe.
see in my code
Canvas.RightToLeftText:= true;
could not compile otherwise
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
Pages: 1