Graphic does't show when too close to right and upper margin

  • Hi,

    I am trying to draw a graphic in the upper right corner of
    a DIN A4 page and create a PDF. Drawing the graphic to
    the middle of the page works fine, but when I change the
    coordinates to draw it into the upper right corner, it just
    does not show.
    When trying different coordinates, I was able to move it
    a bit to the upper right corner, but when the left and top
    coordinates of the graphic exceeded a certain value, the
    graphic just did not show.

    I tried that both with a JPG and a Metafile.

    Do you have any clue what's going on?


    Thanks,

    Christian


    PS:
    This is the code I used for my tests:


    procedure TPDFWriter.DrawLogo;
    var
    R: TRect;
    Meta: TMetaFile;
    begin
    R.Left := 8500;
    R.Top := 311;
    R.Bottom := 1302;
    R.Right := 10335;
    Meta := TMetaFile.Create;
    try
    Meta.LoadFromFile('C:\programmierung\reportprinter\Logo.wmf');
    FPDFPrinter.Canvas.StretchDraw(R, Meta);
    finally
    Meta.Free;
    end;
    end;

  • Hi,

    unfortunately, this does not work.

    When I use the following coordinates, the metafile
    shows on the left hand side of the page:
    R.Top := 1000;
    R.Bottom := 1800;
    R.Left := 2000;
    R.Right := 2500;

    When I increase the R.Left and R.Right value so that
    the metafile should appear a bit more on the right,
    it disappears completely:
    R.Top := 1000;
    R.Bottom := 1800;
    R.Left := 3000;
    R.Right := 3500;
    I do not know why this happens, because with these coordinates,
    the logo should still be on the A4 page ...


    Christian

  • Hi,

    the same goes for Canvas.Draw:

    FPDFPrinter.Canvas.Draw(2000,1, Meta) works and shows the logo on the left hand side of the page.

    With FPDFPrinter.Canvas.Draw(3000,1, Meta) it should be a bit more to the right, but it does not show at all.

    The page width is 11907.


    Christian

  • Hi Julian,

    when 'Printer' is NOT selected as wPDF.CanvasReference, a
    FPDFPrinter.Canvas.Draw(8000,1, Meta)
    still works, but a
    FPDFPrinter.Canvas.Draw(9000,1, Meta);
    fails.

    But when drawing at 8000, the graphic is still very far away from
    the right margin.

    Do you have any clue?


    Thanks in advance,

    Christian