I want to print a letterpapers complete page as background using wPDF.
May be that's possible using the watermark function.
The letterpapers files are available als PDF, EMF oder BMP file,
I want to print this file as Background and above it an output of the developers express printing system. The printing without background works without errors. Is there an easy way to print it directly in one PDF with the background file als watermark. The background should be underlayed meaning that der List output ist printed over the background.
Code
Function TFWPDF.CreatePDF (FN : String) : Boolean;
Var
I,W,H,Res : Integer;
Begin
Result := FileErase(FN);
If Result Then Result := Not FileExists(FN);
If Result Then
Begin
Application.ProcessMessages;
CP.RebuildReport(Nil);
PDF.Filename := FN;
PDF.Modes := [wpClipRectSupport,wpAlwaysHighResPDF];
PDF.BeginDoc;
Dateiname := '';
Try
For I := 0 To CP.GetPageCount - 1 Do
Begin
With CP.CurrentLink.RealPrinterPage Do
Begin
Res := Screen.PixelsPerInch;
W := MulDiv(PageSizePixels.X,res,100);
H := MulDiv(PageSizePixels.Y,res,100);
{ Prüfung of Quer oder Hochformat}
If W > H Then
Begin { Querformat DIN A4}
h := Round(21/2.54*res);
w := Round(29.7/2.54*res);
End
Else
Begin { Hochformat DIN A4 }
w := Round(21/2.54*res);
h := Round(29.7/2.54*res);
End;
PDF.StartPage(W,H,Res,Res,0);
CP.PaintPage(PDF.Canvas,I,Rect(0,0,W,H),PaintRectPixels);
End;
PDF.EndPage;
End;
Dateiname := FN;
Finally
PDF.EndDoc;
End;
End;
Application.ProcessMessages;
End;
Alles anzeigen