Page 1 of 1

Left, right, top and bottom distances of image in pdf page.

Posted: Wed May 23, 2018 8:11 am
by dkaip
I have a wxPdfDocument file and inserting an image how i know right and bottom image distances in page?
The pdf page is 210X297 mm, and import an image with file.InsertImage(image).
Left is with GetX(), top with GetY() functions, but the others?


Code: Select all

bool InsertImage(wxString image)
{
    AddPage(-1,210,297);
    wxImage pageimage(image);
    double x=210
    double y=297
    double dx=pageimage.GetWidth();
    double dy=pageimage.GetHeight();
    double x1=10;
    double y1=30;

    if(x/dx<=y/dy)
        Image(image,x1,y1,x-2*x1,0);
    else
        Image(image,x1,y1,0,y-2*y1+x1);

    return true;
}


Re: Left, right, top and bottom distances of image in pdf page.

Posted: Thu Jun 07, 2018 6:25 pm
by utelle
dkaip wrote:I have a wxPdfDocument file and inserting an image how i know right and bottom image distances in page?
The pdf page is 210X297 mm, and import an image with file.InsertImage(image).
Left is with GetX(), top with GetY() functions, but the others?
Use methods GetLastImageBottomRightX and GetLastImageBottomRightY to get the position of the bottom right corner of the image after the call to method Image.

Regards,

Ulrich