wPdf V3 and Fastreport 4

  • I don't know why but now when i export (using wpdf V3) FR4 reports i have a pdf larger than the report (A4). So when the PDF is printed the report is cut. What could be the problem ?
    I remember this thing was working and don't know when the problem started. Maybe when i have upgraded from FR3 to FR4 ...

    thanks a lot for any help. Need to solve this thing urgently :|

    The code i use is:

    procedure
    fr_2_wpdf(report:Tfrxreport;wpdf:TWPPDFPRINTER;pdf_file:string;start_page,end_page:integer);
    var
    i: integer;
    Pg: TfrxReportPage;
    begin
    wPDF.canvasreference:=wprefScreen;

    With report do
    begin
    if ((start_page=0) and (end_page=0)) then
    begin
    end_page:=previewpages.Count-1;
    end
    else begin
    start_page:=start_page-1;
    end_page:=end_page-1;
    end;

    if previewpages.Count <> 0 then
    begin
    wPDF.filename:=pdf_file;

    wPDF.BeginDoc;

    for i := start_page to end_page do
    begin
    Pg:=PreviewPages.Page[i];

    wPDF.StartPage(MulDiv(trunc(pg.width),72,72),
    MulDiv(trunc(pg.height),72,72),
    72, 72,0);

    PreviewPages.DrawPage(i, wPDF.canvas, 1, 1, 0, 0);

    wPdf.EndPage;
    end;

    wPDF.EndDoc;
    end;
    end;
    end;

    wpdf properties are:

    object wPDF: TWPPDFPrinter
    CidFontMode = wpCIDOff
    PDFAMode = wpdfaOff
    PDFReadMode = wpdfStandard
    CanvasReference = wprefScreen
    AutoLaunch = False
    EncodeStreamMethod = wpEncodeNone
    CompressStreamMethod = wpCompressFlate
    Info.IsUTF8 = False
    Info.Producer = 'WPTools'
    CreateThumbnails = False
    CreateOutlines = False
    Modes = []
    Options = []
    PageMode = pwUseNone
    ZoomMode = pwZoomDefault
    FontMode = wpUseTrueTypeFonts
    Encryption = []
    Security = wpp40bit
    InMemoryMode = False
    JPEGQuality = wpJPEG_100
    ExtraMessages = []
    InputfileMode = pwIgnoreInput
    ConvertJPEGData = False
    DebugMode = False
    Left = 164
    Top = 66
    end

  • Changing the code in:

    wPDF.StartPage(MulDiv(trunc(pg.width),Screen.PixelsPerInch,Screen.PixelsPerInch),
    MulDiv(trunc(pg.height),Screen.PixelsPerInch,Screen.PixelsPerInch),
    Screen.PixelsPerInch, Screen.PixelsPerInch,0);


    works fine

    Roberto