Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to know the PDF file name using a CGPDFDictionaryRef object reference

I have an object of type CGPDFDictionaryRef returned somehow from a method that is considered as a part of a static library (so I do not have access to its code to modify it), however, I want to know the name of the PDF file that this dictionary object holds ? how can I query it to get the name of the file?

like image 733
JAHelia Avatar asked Dec 27 '22 07:12

JAHelia


1 Answers

There are two functions that take a CGPDFDocumentRef and return a CGPDFDictionaryRef. They are CGPDFDocumentGetInfo and CGPDFDocumentGetCatalog. Neither function returns a dictionary that contains the name of the original file. Neither does the array returned by CGPDFDocumentGetID.

This makes sense, because you can create a CGPDFDocumentRef without a file, from data you get over a socket or by drawing into a CGPDFContext with Quartz 2D.

If you want the name of the file, you'll have to get it some other way.

like image 107
rob mayoff Avatar answered Feb 15 '23 02:02

rob mayoff