On 1/4/25 4:30 AM, Gabriel Zachmann via Cocoa-dev wrote:
I am using CALayer's to display images with some animations.

Now, I would like to display PDFs (just the first page).

Could some kind soul please explain to me how to load PDFs?

And would I then just add such a PDF object as layer.contents ?

All hints will be highly appreciated.

Best regards, Gabriel

I'm sure there's more than one way to do it, but one way is to create an NSPDFImageRep. You can then get a CGImageRef from that, or on macOS, create an NSImage and set that as the layer contents.

_______________________________________________

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

Reply via email to