Try it out! > On Jan 5, 2025, at 11:47 AM, Gabriel Zachmann via Cocoa-dev > <cocoa-dev@lists.apple.com> wrote: > > Thanks a lot to both of you! > >> 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. >> > > I forget to mention that I am developing an app for macOS. Sorry! > > So, being totally new to handling PDFs in my code, I would use something like > PDFDocument *pdfDoc = [[PDFDocument alloc] initWithURL:url]; > then something like > imagePDFrep = [NSPDFImageRep imageRepWithData: pdfDoc]; > then something like > imageOfFirstPage = [ [NSImage init] addRepresentation: imagePDFrep]; > ? > > Is that the general gist of it? > > > Best, G. > > _______________________________________________ > > 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/zav%40mac.com > > This email sent to z...@mac.com
_______________________________________________ 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