Re: Using CALayer to display a PDF ?
site_archiver@lists.apple.com Delivered-To: cocoa-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=frameforge.com; s=hostingermail-a; t=1736014001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tzISkmpiDbIq4vqA15kF/UT6WlyMrYeiwj6Wlgyl4tU=; b=MHwfkiMsoPwRyauA94Nble8Qzy6mJy181goTV/wMyDIsTNuq/KDQFcnTJvF9ZhM5bX3ylX 3TJUhOJW65a6/StWPrIx9XuyGTo7VnGLSaVMKVSFFMj5ySWIgVI2Ou+UsaF2OUPHwWSIof Rn1iz3o+4ku7N3I2Tcl4vZ0PVBdvosTg+CokzKIzXaOIBNc9cJesBQyFneSqjk/4++tz4Y c0c3hZ/fAgrqGD4zjn9q17l52ho9pBmcTBXPfW05tiD9VPOZ4mRQ1zqbWs3PE+EyoJqNT6 nul3zfXv2pWYizuxFDocrZx225YXK6BiUAudefpwjA4W8c7ovvKoosFW7Z4uxw== User-agent: Mozilla Thunderbird 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 _______________________________________________ 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/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com 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.
participants (1)
-
James Walker via Cocoa-dev