CGPDFDocument and local data

1k views Asked by At

I have some NSData in Core Data db (it's pdf data) and I would like to print my pdf with CGPDFDocument. I have to use url of the data but I don't know how to make this with a local data (in my Core Data db). Someone has an idea ? :)

Thanks !

1

There are 1 answers

0
0xced On BEST ANSWER

If you are on macOS, use -[PDFDocument initWithData:].

If you are on iOS, use CGPDFDocumentCreateWithProvider with a CGDataProviderRef.

Also, this is a duplicate of CGPDFDocumentRef from NSData.