Using wpdf version 3.51 and Delphi 7 and exporting from a Dev Express grid.
If the screen resolution os 1280 x 1024, the PDF that is created is correct.
However, if the resolution is 1280 x 800, the PDF is not correct.
The last 10 lines of each page are dropped.
Note: If the report is landscape, the PDF is correct at either resolution.
Tried changing the CanvasPreference to wprefPrinter, but that did not help. This change caused the PDF size (report generated in the PDF) to be extremely small.
Here is a code sample that we use in our applications.
begin
Self.dxCmpntPrtrDetail.RebuildReport(nil);
WPDF_Start(LicenseNamePDF, LicenseCodePDF);
WPPDFPrinter1 := TWPPDFPrinter.Create(nil);
WPPDFPrinter1.Filename := FileName;
WPPDFPrinter1.OwnerPassword := 'ViewOnly';
WPPDFPrinter1.Encryption := [wpEncryptFile, wpEnablePrinting, wpEnableCopying];
WPPDFPrinter1.Info.Author := 'L.L. Low Associates, Inc.';
WPPDFPrinter1.Modes := [wpClipRectSupport, wpAlwaysHighResPDF];
WPPDFPrinter1.CanvasReference := wprefPrinter;
WPPDFPrinter1.BeginDoc;
try
for i := 0 to Pred(Self.dxCmpntPrtrDetail.GetPageCount()) do
begin
with Self.dxCmpntPrtrDetail.CurrentLink.RealPrinterPage do
begin
res := Screen.PixelsPerInch;
w := MulDiv(PageSizePixels.X, res, 100);
h := MulDiv(PageSizePixels.Y, res, 100);
WPPDFPrinter1.StartPage(w, h, res, res, 0);
Self.dxCmpntPrtrDetail.PaintPage(
WPPDFPrinter1.Canvas, i, Rect(0, 0, w, h), PaintRectPixels);
end;
WPPDFPrinter1.EndPage;
end
finally
WPPDFPrinter1.EndDoc;
end;
end;
Any suggestions?
Thanks - Tom Greenway