You are not logged in.
Pages: 1
Hello friends.
My metafile doesn't has margins, but I would like to make a PDF with margins (left and top).
Now the PDF always stay in Left = Top = 0
I would like that my PDF had Left=0.5 cm and Top = 0.5 cm.
I tried without success. I already found post but nothing that help to solve my problem.
Thanks any help.
Offline
Sorry for bother you, I already solve the problem.
My calculation was incorrect. The code bellow it's correct for me.
xWidth := xRepClass.PageCtrl.FMeta.Width;
xHeight := xRepClass.PageCtrl.FMeta.Height;
xLeft := Round(FCfgPage.Left * PixelsCentimeters);
xTop := Round(FCfgPage.Top * PixelsCentimeters);
xRight := Round(FCfgPage.Right * PixelsCentimeters);
xBottom := Round(FCfgPage.Bottom * PixelsCentimeters);
xLeft := MulDiv(xLeft, 72, Screen.PixelsPerInch);
xTop := MulDiv(xTop, 72, Screen.PixelsPerInch);
xRight := MulDiv(xRight, 72, Screen.PixelsPerInch);
xBottom := MulDiv(xBottom, 72, Screen.PixelsPerInch);
xWidth := MulDiv(xWidth, 72, xPDF.ScreenLogPixels);
xHeight := MulDiv(xHeight, 72, xPDF.ScreenLogPixels);
xWidth := xWidth + xLeft + xRight;
xHeight := xHeight + xTop + xBottom;
xPDF.DefaultPageWidth := xWidth;
xPDF.DefaultPageHeight := xHeight;
xPDF.AddPage;
xPDF.Canvas.RenderMetaFile(xRepClass.PageCtrl.FMeta, 1.0, xLeft, xTop);
Offline
Pages: 1