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

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 333
Joined: Wed Jan 20, 2010 1:15 pm

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

Post 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;
}

utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

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

Post 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
Post Reply