I draw an NSImage within an NSView scaling its size in order to fill the image within the view bounds. The image is larger than the NSView's bounds, but on the display it looks well clipped to those bounds. Since the image's NSView is a subView of the page's NSView, I create a PDF saving that page's NSView [pageView dataWithPDFInsideRect:pageRect]; and I get a pdf file. Anyway, when I inspect the pdf file with Acrobat, I clearly see that the image hasn't been cropped. As I see from the blue rectangle around the visible small image, the whole original and larger image has been embedded within the pdf document. In facts if I Control-Click-Edit the image on the pdf, I get the original whole image. So the pdf file size results bigger than what it would really be. I don't get this trouble when saving the page to a TIFF or any other raster image file (with NSBitmapImageRep -> CGImage -> displayRectIgnoringOpacity -> CGImageDestinationFinalize). My question: Do you know an option, any API, to clip the image to its NSView's frame on the pdf, as it properly looks on the display? Or should I clip the image by my own code?
Regards -- Leonardo _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com