PDF not being generated correctly - screen resolution

  • 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

    • Offizieller Beitrag

    Hi,

    thanks for Your e-mail.

    I think the solution we found works now:

  • In doing some additional testing ran into another problem where the exported PDF drops data (both column headings and data).

    The missing data is on the right side of the report.

    Note:
    I sent a separate email to support@wpdftools with examples.

    Any ideas why this is not working?

    Thanks,
    Tom Greenway

  • Additional information...

    We are using Developer's Express grids and when the Enable Auto Column width is used, the PDF is not created correctly (see examples sent in earlier messages).

    If the Auto Column width is disabled, the PDF is created correctly.

    When our applications used wPDF 3.0, the PDF files were created correctly with either Auto Column Width enabled or disabled.

    wPDF versions 3.21 and 3.51 do not create the PDF correctly unless the Auto Column Width is disabled.