0

I am getting the "F1.0" in Tf callback method in CGPDFScanner. But I am not getting how I can go ahead with "F1.0"

After doing some search I come to know that it is king of font detail. How Can I Decode this value.

uttam
  • 1,364
  • 4
  • 20
  • 35

1 Answers1

1

The font objects are located in the /Resources dictionary. If you are parsing a page content stream, you get the font object like this: get the /Resources dictionary from the Page dictionary. From the /Resources dictionary get the /Font dictionary. From the /Font dictionary get the font dictionary with your label, /F1.0. Basically the code looks like this (you need to add the error handling code because these dictionaries can be NULL):

CGPDFDictionaryRef pageDictionary = CGPDFPageGetDictionary(pdfPage);

CGPDFDictionaryRef resourcesDictionary;
CGPDFDictionaryGetDictionary(pageDictionary, "Resources", &resourcesDictionary);

CGPDFDictionaryRef fontDictionary;
CGPDFDictionaryGetDictionary(resourcesDictionary, "Font", &fontDictionary);

CGPDFDictionaryRef f10FontDictionary;
CGPDFDictionaryGetDictionary(fontDictionary, "F1.0", &f10FontDictionary);

The f10FontDictionary will contain the font object. The entries in this dictionary are detailed in the PDF specification.

iPDFdev
  • 5,229
  • 2
  • 17
  • 18
  • Thanks for reply. but I am not getting how to go to next level. means how to find the f10FontDictionary detail for more specification.can you please give me some more code of this ?. – uttam Feb 09 '12 at 11:51
  • PDF specification is available here: http://www.adobe.com/devnet/pdf/pdf_reference_archive.html. The entries in the font object dictionary are listed in sections 5.4, 5.5, 5.6. (PDF specification 1.7) – iPDFdev Feb 09 '12 at 15:31