Question

I am working on pdf creation right now, everything works fine except image drawing, it draws image's upper left corner only; with extra zoomed. But it works on simulator,code shows below;

UIImage *plotImage=[[UIImage alloc]initWithContentsOfFile:
[localPictureArray objectAtIndex:i]];
    [plotImage drawInRect:CGRectMake
(kMargin, currentPageY, plotImage.size.width, plotImage.size.height)];

since iam a starter i need your valuable help. thanks in advance.

Was it helpful?

Solution

The problem is likely your CGRect. Assuming that your x and y margins are OK, you probably have an image that is too large to fit on the page as measured from these margins.

You need to determine how far you can draw to the right and bottom and scale the image accordingly. (e.g. as described here)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top