You are not logged in.
Pages: 1
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
Offline
Thanks
Just a stupid bug
Offline
Pages: 1